From f1ce9e6be5dcf177f3c54f9ec11ee981efae3fd9 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 4 Mar 2020 16:09:29 -0800 Subject: [PATCH] feat!: move to typescript code generation (#264) * update from synthtool * move to typescript * update synth script and run it * convert system-test to ts * try this * lint * regenerate to pick up change for path template * update client * gts fix * update copyright * 2020 copyright * try this * fix unit test * re-generate * make sample test work * remove sample test for IAM policy * liny * remove doc, revert sample-test * add iam client to kmsClient * update sample-test * lint * makes samples test work * lint * update * convert system-tets to ts * rerun synthtool * sample test * fix * mix-in * update synthtool * run synthtool & test * test * manual add IamClient and pass unit tests * clean up * npm run lint * test samples * manual iam_service_config * ts client interface overload * test * test * return value * return list * clean up * remove console warn * sample-test work! * require module correctly * synthtool change * include all files in tarball, system-test passes * synthtool, all tests green * merge * fix for system-test * feedback * update dependencies * license aligned for helper.ts * remove helper.ts, tslint from synth.py * move script around * add comments to iamclient & synth.py * rename helperMethods.tmpl * rerun ynthtool * give auth the type * re set up scripts in package.json * add meaningful comment * add comments in helperMethods.tmpl * test * import * as packagejson from ../package.json; * remove any * run synthtool --- packages/google-cloud-kms/.gitignore | 5 +- packages/google-cloud-kms/.jsdoc.js | 5 +- .../google-cloud-kms/helperMethods.ts.tmpl | 33 + packages/google-cloud-kms/package.json | 57 +- .../google/cloud/common_resources.proto | 52 + .../protos/google/iam/v1/iam_policy.proto | 60 +- .../google/iam/v1/logging/audit_data.proto | 34 + .../protos/google/iam/v1/options.proto | 41 + .../protos/google/iam/v1/policy.proto | 240 + packages/google-cloud-kms/protos/protos.d.ts | 15952 +++--- packages/google-cloud-kms/protos/protos.js | 45409 ++++++++-------- packages/google-cloud-kms/protos/protos.json | 3196 +- .../src/extra_proto_list.json | 5 + packages/google-cloud-kms/src/helper.ts | 260 + .../src/iam_policy_service_client_config.json | 39 + packages/google-cloud-kms/src/index.js | 82 - .../google/iam/v1/doc_options.js => index.ts} | 14 +- .../doc/google/cloud/kms/v1/doc_resources.js | 776 - .../v1/doc/google/cloud/kms/v1/doc_service.js | 776 - .../src/v1/doc/google/iam/v1/doc_policy.js | 16 - .../v1/doc/google/protobuf/doc_duration.js | 97 - .../v1/doc/google/protobuf/doc_field_mask.js | 228 - .../v1/doc/google/protobuf/doc_timestamp.js | 119 - .../src/v1/doc/google/type/doc_expr.js | 16 - .../src/{browser.js => v1/index.ts} | 14 +- .../src/v1/key_management_service_client.js | 2963 - .../src/v1/key_management_service_client.ts | 2963 + .../key_management_service_client_config.json | 128 +- .../v1/key_management_service_proto_list.json | 3 +- packages/google-cloud-kms/synth.metadata | 19 +- packages/google-cloud-kms/synth.py | 60 +- .../system-test/.eslintrc.yml | 4 - .../fixtures/sample/src/index.js} | 17 +- .../fixtures/sample/src/index.ts} | 14 +- .../google-cloud-kms/system-test/install.ts | 51 + .../system-test/{kms.js => kms.ts} | 10 +- .../test/gapic-key_management_iam_service.ts | 124 + .../test/gapic-key_management_service-v1.ts | 1341 + packages/google-cloud-kms/test/gapic-v1.js | 2014 - packages/google-cloud-kms/tsconfig.json | 19 + packages/google-cloud-kms/tslint.json | 3 + packages/google-cloud-kms/webpack.config.js | 40 +- 42 files changed, 38072 insertions(+), 39227 deletions(-) create mode 100644 packages/google-cloud-kms/helperMethods.ts.tmpl create mode 100644 packages/google-cloud-kms/protos/google/cloud/common_resources.proto create mode 100644 packages/google-cloud-kms/protos/google/iam/v1/logging/audit_data.proto create mode 100644 packages/google-cloud-kms/protos/google/iam/v1/options.proto create mode 100644 packages/google-cloud-kms/protos/google/iam/v1/policy.proto create mode 100644 packages/google-cloud-kms/src/extra_proto_list.json create mode 100644 packages/google-cloud-kms/src/helper.ts create mode 100644 packages/google-cloud-kms/src/iam_policy_service_client_config.json delete mode 100644 packages/google-cloud-kms/src/index.js rename packages/google-cloud-kms/src/{v1/doc/google/iam/v1/doc_options.js => index.ts} (50%) delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_resources.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_service.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_duration.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-kms/src/v1/doc/google/type/doc_expr.js rename packages/google-cloud-kms/src/{browser.js => v1/index.ts} (64%) delete mode 100644 packages/google-cloud-kms/src/v1/key_management_service_client.js create mode 100644 packages/google-cloud-kms/src/v1/key_management_service_client.ts delete mode 100644 packages/google-cloud-kms/system-test/.eslintrc.yml rename packages/google-cloud-kms/{src/v1/doc/google/iam/v1/doc_iam_policy.js => system-test/fixtures/sample/src/index.js} (56%) rename packages/google-cloud-kms/{src/v1/index.js => system-test/fixtures/sample/src/index.ts} (59%) create mode 100644 packages/google-cloud-kms/system-test/install.ts rename packages/google-cloud-kms/system-test/{kms.js => kms.ts} (82%) create mode 100644 packages/google-cloud-kms/test/gapic-key_management_iam_service.ts create mode 100644 packages/google-cloud-kms/test/gapic-key_management_service-v1.ts delete mode 100644 packages/google-cloud-kms/test/gapic-v1.js create mode 100644 packages/google-cloud-kms/tsconfig.json create mode 100644 packages/google-cloud-kms/tslint.json diff --git a/packages/google-cloud-kms/.gitignore b/packages/google-cloud-kms/.gitignore index ee083ec7909..5d32b23782f 100644 --- a/packages/google-cloud-kms/.gitignore +++ b/packages/google-cloud-kms/.gitignore @@ -1,13 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ out/ build/ system-test/secrets.js system-test/*key.json -**/*.lock -**/package-lock.json +*.lock .DS_Store +package-lock.json __pycache__ diff --git a/packages/google-cloud-kms/.jsdoc.js b/packages/google-cloud-kms/.jsdoc.js index 16fe33a4a50..ca582a015ab 100644 --- a/packages/google-cloud-kms/.jsdoc.js +++ b/packages/google-cloud-kms/.jsdoc.js @@ -12,6 +12,9 @@ // 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'; @@ -31,7 +34,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src', + 'build/src', 'protos' ], includePattern: '\\.js$' diff --git a/packages/google-cloud-kms/helperMethods.ts.tmpl b/packages/google-cloud-kms/helperMethods.ts.tmpl new file mode 100644 index 00000000000..f552e3b353a --- /dev/null +++ b/packages/google-cloud-kms/helperMethods.ts.tmpl @@ -0,0 +1,33 @@ + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/packages/google-cloud-kms/package.json b/packages/google-cloud-kms/package.json index bd74b670315..9e5923ddddf 100644 --- a/packages/google-cloud-kms/package.json +++ b/packages/google-cloud-kms/package.json @@ -8,12 +8,10 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-kms", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "protos", - "src", - "AUTHORS", - "COPYING" + "build/protos", + "build/src" ], "keywords": [ "google apis client", @@ -29,31 +27,44 @@ "Google Cloud Key Management Service (KMS) API" ], "scripts": { - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "test": "c8 mocha", - "lint": "eslint '**/*.js'", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "lint": "gts fix && eslint samples/*.js", + "fix": "gts fix && eslint --fix samples/*.js", + "prelint": "cd samples; npm link ../; npm i", + "system-test": "mocha build/system-test", "docs": "jsdoc -c .jsdoc.js", - "system-test": "mocha system-test/ smoke-test/ --timeout 600000", - "fix": "eslint '**/*.js' --fix", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../; npm i" + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile" }, "dependencies": { - "google-gax": "^1.7.5" + "google-gax": "^1.14.2" }, "devDependencies": { - "codecov": "^3.0.4", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", + "@types/mocha": "^7.0.2", + "@types/node": "^13.7.7", + "c8": "^7.1.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", - "linkinator": "^2.0.0", - "mocha": "^7.0.0", - "c8": "^7.0.0", - "prettier": "^1.13.7" + "eslint-plugin-prettier": "^3.1.2", + "gts": "^1.1.2", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.3", + "mocha": "^7.1.0", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "power-assert": "^1.6.1", + "prettier": "^1.19.1", + "ts-loader": "^6.2.1", + "typescript": "^3.7.0", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11" } } diff --git a/packages/google-cloud-kms/protos/google/cloud/common_resources.proto b/packages/google-cloud-kms/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-kms/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-kms/protos/google/iam/v1/iam_policy.proto b/packages/google-cloud-kms/protos/google/iam/v1/iam_policy.proto index a272fe8d7d9..7072854e4c0 100644 --- a/packages/google-cloud-kms/protos/google/iam/v1/iam_policy.proto +++ b/packages/google-cloud-kms/protos/google/iam/v1/iam_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2016 Google Inc. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,13 +11,18 @@ // 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.iam.v1; -import "google/api/annotations.proto"; +import "google/iam/v1/options.proto"; import "google/iam/v1/policy.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Iam.V1"; @@ -27,7 +32,6 @@ option java_outer_classname = "IamPolicyProto"; option java_package = "com.google.iam.v1"; option php_namespace = "Google\\Cloud\\Iam\\V1"; - // ## API Overview // // Manages Identity and Access Management (IAM) policies. @@ -54,61 +58,83 @@ option php_namespace = "Google\\Cloud\\Iam\\V1"; // are created and deleted implicitly with the resources to which they are // attached. service IAMPolicy { + option (google.api.default_host) = "iam-meta-api.googleapis.com"; + // Sets the access control policy on the specified resource. Replaces any // existing policy. rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy) { - option (google.api.http) = { post: "/v1/{resource=**}:setIamPolicy" body: "*" }; + option (google.api.http) = { + post: "/v1/{resource=**}:setIamPolicy" + body: "*" + }; } // Gets the access control policy for a resource. // Returns an empty policy if the resource exists and does not have a policy // set. rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy) { - option (google.api.http) = { post: "/v1/{resource=**}:getIamPolicy" body: "*" }; + option (google.api.http) = { + post: "/v1/{resource=**}:getIamPolicy" + body: "*" + }; } // 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. rpc TestIamPermissions(TestIamPermissionsRequest) returns (TestIamPermissionsResponse) { - option (google.api.http) = { post: "/v1/{resource=**}:testIamPermissions" body: "*" }; + option (google.api.http) = { + post: "/v1/{resource=**}:testIamPermissions" + body: "*" + }; } } // Request message for `SetIamPolicy` method. message SetIamPolicyRequest { // REQUIRED: The resource for which the policy is being specified. - // `resource` is usually specified as a path. For example, a Project - // resource is specified as `projects/{project}`. - string resource = 1; + // See the operation documentation for the appropriate value for this field. + string resource = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; // REQUIRED: The complete policy to be applied to the `resource`. The size of // the policy is limited to a few 10s of KB. An empty policy is a // valid policy but certain Cloud Platform services (such as Projects) // might reject them. - Policy policy = 2; + Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for `GetIamPolicy` method. message GetIamPolicyRequest { // REQUIRED: The resource for which the policy is being requested. - // `resource` is usually specified as a path. For example, a Project - // resource is specified as `projects/{project}`. - string resource = 1; + // See the operation documentation for the appropriate value for this field. + string resource = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; + + // OPTIONAL: A `GetPolicyOptions` object for specifying options to + // `GetIamPolicy`. This field is only used by Cloud IAM. + GetPolicyOptions options = 2; } // Request message for `TestIamPermissions` method. message TestIamPermissionsRequest { // REQUIRED: The resource for which the policy detail is being requested. - // `resource` is usually specified as a path. For example, a Project - // resource is specified as `projects/{project}`. - string resource = 1; + // See the operation documentation for the appropriate value for this field. + string resource = 1[ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; // The set of permissions to check for the `resource`. Permissions with // wildcards (such as '*' or 'storage.*') are not allowed. For more // information see // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - repeated string permissions = 2; + repeated string permissions = 2 [(google.api.field_behavior) = REQUIRED]; } // Response message for `TestIamPermissions` method. diff --git a/packages/google-cloud-kms/protos/google/iam/v1/logging/audit_data.proto b/packages/google-cloud-kms/protos/google/iam/v1/logging/audit_data.proto new file mode 100644 index 00000000000..dfe441ba663 --- /dev/null +++ b/packages/google-cloud-kms/protos/google/iam/v1/logging/audit_data.proto @@ -0,0 +1,34 @@ +// Copyright 2017 Google Inc. +// +// 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.iam.v1.logging; + +import "google/api/annotations.proto"; +import "google/iam/v1/policy.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V1.Logging"; +option go_package = "google.golang.org/genproto/googleapis/iam/v1/logging;logging"; +option java_multiple_files = true; +option java_outer_classname = "AuditDataProto"; +option java_package = "com.google.iam.v1.logging"; + +// Audit log information specific to Cloud IAM. This message is serialized +// as an `Any` type in the `ServiceData` message of an +// `AuditLog` message. +message AuditData { + // Policy delta between the original policy and the newly set policy. + google.iam.v1.PolicyDelta policy_delta = 2; +} diff --git a/packages/google-cloud-kms/protos/google/iam/v1/options.proto b/packages/google-cloud-kms/protos/google/iam/v1/options.proto new file mode 100644 index 00000000000..a4e17e588db --- /dev/null +++ b/packages/google-cloud-kms/protos/google/iam/v1/options.proto @@ -0,0 +1,41 @@ +// Copyright 2019 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.iam.v1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Iam.V1"; +option go_package = "google.golang.org/genproto/googleapis/iam/v1;iam"; +option java_multiple_files = true; +option java_outer_classname = "OptionsProto"; +option java_package = "com.google.iam.v1"; +option php_namespace = "Google\\Cloud\\Iam\\V1"; + +// Encapsulates settings provided to GetIamPolicy. +message GetPolicyOptions { + // Optional. The policy format version to be returned. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Requests for policies with any conditional bindings must specify version 3. + // Policies without any conditional bindings may specify any valid value or + // leave the field unset. + int32 requested_policy_version = 1; +} diff --git a/packages/google-cloud-kms/protos/google/iam/v1/policy.proto b/packages/google-cloud-kms/protos/google/iam/v1/policy.proto new file mode 100644 index 00000000000..e3aba47e8ea --- /dev/null +++ b/packages/google-cloud-kms/protos/google/iam/v1/policy.proto @@ -0,0 +1,240 @@ +// Copyright 2019 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.iam.v1; + +import "google/type/expr.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Iam.V1"; +option go_package = "google.golang.org/genproto/googleapis/iam/v1;iam"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.iam.v1"; +option php_namespace = "Google\\Cloud\\Iam\\V1"; + +// Defines an Identity and Access Management (IAM) policy. It is used to +// specify access control policies for Cloud Platform resources. +// +// +// A `Policy` is a collection of `bindings`. A `binding` binds one or more +// `members` to a single `role`. Members can be user accounts, service accounts, +// Google groups, and domains (such as G Suite). A `role` is a named list of +// permissions (defined by IAM or configured by users). A `binding` can +// optionally specify a `condition`, which is a logic expression that further +// constrains the role binding based on attributes about the request and/or +// target resource. +// +// **JSON Example** +// +// { +// "bindings": [ +// { +// "role": "roles/resourcemanager.organizationAdmin", +// "members": [ +// "user:mike@example.com", +// "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +// ] +// }, +// { +// "role": "roles/resourcemanager.organizationViewer", +// "members": ["user:eve@example.com"], +// "condition": { +// "title": "expirable access", +// "description": "Does not grant access after Sep 2020", +// "expression": "request.time < +// timestamp('2020-10-01T00:00:00.000Z')", +// } +// } +// ] +// } +// +// **YAML Example** +// +// bindings: +// - members: +// - user:mike@example.com +// - group:admins@example.com +// - domain:google.com +// - serviceAccount:my-project-id@appspot.gserviceaccount.com +// role: roles/resourcemanager.organizationAdmin +// - members: +// - user:eve@example.com +// role: roles/resourcemanager.organizationViewer +// condition: +// title: expirable access +// description: Does not grant access after Sep 2020 +// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +// +// For a description of IAM and its features, see the +// [IAM developer's guide](https://cloud.google.com/iam/docs). +message Policy { + // Specifies the format of the policy. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Operations affecting conditional bindings must specify version 3. This can + // be either setting a conditional policy, modifying a conditional binding, + // or removing a binding (conditional or unconditional) from the stored + // conditional policy. + // Operations on non-conditional policies may specify any valid value or + // leave the field unset. + // + // If no etag is provided in the call to `setIamPolicy`, version compliance + // checks against the stored policy is skipped. + int32 version = 1; + + // Associates a list of `members` to a `role`. Optionally may specify a + // `condition` that determines when binding is in effect. + // `bindings` with no members will result in an error. + repeated Binding bindings = 4; + + // `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a policy from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform policy updates in order to avoid race + // conditions: An `etag` is returned in the response to `getIamPolicy`, and + // systems are expected to put that etag in the request to `setIamPolicy` to + // ensure that their change will be applied to the same version of the policy. + // + // If no `etag` is provided in the call to `setIamPolicy`, then the existing + // policy is overwritten. Due to blind-set semantics of an etag-less policy, + // 'setIamPolicy' will not fail even if the incoming policy version does not + // meet the requirements for modifying the stored policy. + bytes etag = 3; +} + +// Associates `members` with a `role`. +message Binding { + // Role that is assigned to `members`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + string role = 1; + + // Specifies the identities requesting access for a Cloud Platform resource. + // `members` can have the following values: + // + // * `allUsers`: A special identifier that represents anyone who is + // on the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. + // + // * `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@example.com` . + // + // + // * `serviceAccount:{emailid}`: An email address that represents a service + // account. For example, `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. + // + // + // * `domain:{domain}`: The G Suite domain (primary) that represents all the + // users of that domain. For example, `google.com` or `example.com`. + // + // + repeated string members = 2; + + // The condition that is associated with this binding. + // NOTE: An unsatisfied condition will not allow user access via current + // binding. Different bindings, including their conditions, are examined + // independently. + google.type.Expr condition = 3; +} + +// The difference delta between two policies. +message PolicyDelta { + // The delta for Bindings between two policies. + repeated BindingDelta binding_deltas = 1; + + // The delta for AuditConfigs between two policies. + repeated AuditConfigDelta audit_config_deltas = 2; +} + +// One delta entry for Binding. Each individual change (only one member in each +// entry) to a binding will be a separate entry. +message BindingDelta { + // The type of action performed on a Binding in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of a Binding. + ADD = 1; + + // Removal of a Binding. + REMOVE = 2; + } + + // The action that was performed on a Binding. + // Required + Action action = 1; + + // Role that is assigned to `members`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // Required + string role = 2; + + // A single identity requesting access for a Cloud Platform resource. + // Follows the same format of Binding.members. + // Required + string member = 3; + + // The condition that is associated with this binding. + google.type.Expr condition = 4; +} + +// One delta entry for AuditConfig. Each individual change (only one +// exempted_member in each entry) to a AuditConfig will be a separate entry. +message AuditConfigDelta { + // The type of action performed on an audit configuration in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of an audit configuration. + ADD = 1; + + // Removal of an audit configuration. + REMOVE = 2; + } + + // The action that was performed on an audit configuration in a policy. + // Required + Action action = 1; + + // Specifies a service that was configured for Cloud Audit Logging. + // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + // `allServices` is a special value that covers all services. + // Required + string service = 2; + + // A single identity that is exempted from "data access" audit + // logging for the `service` specified above. + // Follows the same format of Binding.members. + string exempted_member = 3; + + // Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + // enabled, and cannot be configured. + // Required + string log_type = 4; +} diff --git a/packages/google-cloud-kms/protos/protos.d.ts b/packages/google-cloud-kms/protos/protos.d.ts index 5067935615d..5e1ad6d7b4d 100644 --- a/packages/google-cloud-kms/protos/protos.d.ts +++ b/packages/google-cloud-kms/protos/protos.d.ts @@ -17,9889 +17,10079 @@ import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { - /** Namespace cloud. */ - namespace cloud { + /** Namespace iam. */ + namespace iam { - /** Namespace kms. */ - namespace kms { + /** Namespace v1. */ + namespace v1 { - /** Namespace v1. */ - namespace v1 { + /** Properties of a Policy. */ + interface IPolicy { - /** Represents a KeyManagementService */ - class KeyManagementService extends $protobuf.rpc.Service { + /** Policy version */ + version?: (number|null); - /** - * Constructs a new KeyManagementService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); - /** - * Creates new KeyManagementService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): KeyManagementService; + /** Policy etag */ + etag?: (Uint8Array|string|null); + } - /** - * Calls ListKeyRings. - * @param request ListKeyRingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListKeyRingsResponse - */ - public listKeyRings(request: google.cloud.kms.v1.IListKeyRingsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListKeyRingsCallback): void; + /** Represents a Policy. */ + class Policy implements IPolicy { - /** - * Calls ListKeyRings. - * @param request ListKeyRingsRequest message or plain object - * @returns Promise - */ - public listKeyRings(request: google.cloud.kms.v1.IListKeyRingsRequest): Promise; + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); - /** - * Calls ListCryptoKeys. - * @param request ListCryptoKeysRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCryptoKeysResponse - */ - public listCryptoKeys(request: google.cloud.kms.v1.IListCryptoKeysRequest, callback: google.cloud.kms.v1.KeyManagementService.ListCryptoKeysCallback): void; + /** Policy version. */ + public version: number; - /** - * Calls ListCryptoKeys. - * @param request ListCryptoKeysRequest message or plain object - * @returns Promise - */ - public listCryptoKeys(request: google.cloud.kms.v1.IListCryptoKeysRequest): Promise; + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; - /** - * Calls ListCryptoKeyVersions. - * @param request ListCryptoKeyVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCryptoKeyVersionsResponse - */ - public listCryptoKeyVersions(request: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersionsCallback): void; + /** Policy etag. */ + public etag: (Uint8Array|string); - /** - * Calls ListCryptoKeyVersions. - * @param request ListCryptoKeyVersionsRequest message or plain object - * @returns Promise - */ - public listCryptoKeyVersions(request: google.cloud.kms.v1.IListCryptoKeyVersionsRequest): Promise; + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - /** - * Calls ListImportJobs. - * @param request ListImportJobsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListImportJobsResponse - */ - public listImportJobs(request: google.cloud.kms.v1.IListImportJobsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListImportJobsCallback): void; + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls ListImportJobs. - * @param request ListImportJobsRequest message or plain object - * @returns Promise - */ - public listImportJobs(request: google.cloud.kms.v1.IListImportJobsRequest): Promise; + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls GetKeyRing. - * @param request GetKeyRingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and KeyRing - */ - public getKeyRing(request: google.cloud.kms.v1.IGetKeyRingRequest, callback: google.cloud.kms.v1.KeyManagementService.GetKeyRingCallback): void; + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - /** - * Calls GetKeyRing. - * @param request GetKeyRingRequest message or plain object - * @returns Promise - */ - public getKeyRing(request: google.cloud.kms.v1.IGetKeyRingRequest): Promise; + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - /** - * Calls GetCryptoKey. - * @param request GetCryptoKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKey - */ - public getCryptoKey(request: google.cloud.kms.v1.IGetCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyCallback): void; + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls GetCryptoKey. - * @param request GetCryptoKeyRequest message or plain object - * @returns Promise - */ - public getCryptoKey(request: google.cloud.kms.v1.IGetCryptoKeyRequest): Promise; + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - /** - * Calls GetCryptoKeyVersion. - * @param request GetCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public getCryptoKeyVersion(request: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersionCallback): void; + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Calls GetCryptoKeyVersion. - * @param request GetCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public getCryptoKeyVersion(request: google.cloud.kms.v1.IGetCryptoKeyVersionRequest): Promise; + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls GetPublicKey. - * @param request GetPublicKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PublicKey - */ - public getPublicKey(request: google.cloud.kms.v1.IGetPublicKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.GetPublicKeyCallback): void; + /** Properties of a Binding. */ + interface IBinding { - /** - * Calls GetPublicKey. - * @param request GetPublicKeyRequest message or plain object - * @returns Promise - */ - public getPublicKey(request: google.cloud.kms.v1.IGetPublicKeyRequest): Promise; + /** Binding role */ + role?: (string|null); - /** - * Calls GetImportJob. - * @param request GetImportJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ImportJob - */ - public getImportJob(request: google.cloud.kms.v1.IGetImportJobRequest, callback: google.cloud.kms.v1.KeyManagementService.GetImportJobCallback): void; + /** Binding members */ + members?: (string[]|null); - /** - * Calls GetImportJob. - * @param request GetImportJobRequest message or plain object - * @returns Promise - */ - public getImportJob(request: google.cloud.kms.v1.IGetImportJobRequest): Promise; + /** Binding condition */ + condition?: (google.type.IExpr|null); + } - /** - * Calls CreateKeyRing. - * @param request CreateKeyRingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and KeyRing - */ - public createKeyRing(request: google.cloud.kms.v1.ICreateKeyRingRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateKeyRingCallback): void; + /** Represents a Binding. */ + class Binding implements IBinding { - /** - * Calls CreateKeyRing. - * @param request CreateKeyRingRequest message or plain object - * @returns Promise - */ - public createKeyRing(request: google.cloud.kms.v1.ICreateKeyRingRequest): Promise; + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); - /** - * Calls CreateCryptoKey. - * @param request CreateCryptoKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKey - */ - public createCryptoKey(request: google.cloud.kms.v1.ICreateCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyCallback): void; + /** Binding role. */ + public role: string; - /** - * Calls CreateCryptoKey. - * @param request CreateCryptoKeyRequest message or plain object - * @returns Promise - */ - public createCryptoKey(request: google.cloud.kms.v1.ICreateCryptoKeyRequest): Promise; - - /** - * Calls CreateCryptoKeyVersion. - * @param request CreateCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public createCryptoKeyVersion(request: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersionCallback): void; + /** Binding members. */ + public members: string[]; - /** - * Calls CreateCryptoKeyVersion. - * @param request CreateCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public createCryptoKeyVersion(request: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest): Promise; + /** Binding condition. */ + public condition?: (google.type.IExpr|null); - /** - * Calls ImportCryptoKeyVersion. - * @param request ImportCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public importCryptoKeyVersion(request: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersionCallback): void; + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - /** - * Calls ImportCryptoKeyVersion. - * @param request ImportCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public importCryptoKeyVersion(request: google.cloud.kms.v1.IImportCryptoKeyVersionRequest): Promise; + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls CreateImportJob. - * @param request CreateImportJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ImportJob - */ - public createImportJob(request: google.cloud.kms.v1.ICreateImportJobRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateImportJobCallback): void; + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls CreateImportJob. - * @param request CreateImportJobRequest message or plain object - * @returns Promise - */ - public createImportJob(request: google.cloud.kms.v1.ICreateImportJobRequest): Promise; + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - /** - * Calls UpdateCryptoKey. - * @param request UpdateCryptoKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKey - */ - public updateCryptoKey(request: google.cloud.kms.v1.IUpdateCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyCallback): void; + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - /** - * Calls UpdateCryptoKey. - * @param request UpdateCryptoKeyRequest message or plain object - * @returns Promise - */ - public updateCryptoKey(request: google.cloud.kms.v1.IUpdateCryptoKeyRequest): Promise; + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls UpdateCryptoKeyVersion. - * @param request UpdateCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public updateCryptoKeyVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersionCallback): void; + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - /** - * Calls UpdateCryptoKeyVersion. - * @param request UpdateCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public updateCryptoKeyVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest): Promise; + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Calls Encrypt. - * @param request EncryptRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EncryptResponse - */ - public encrypt(request: google.cloud.kms.v1.IEncryptRequest, callback: google.cloud.kms.v1.KeyManagementService.EncryptCallback): void; + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls Encrypt. - * @param request EncryptRequest message or plain object - * @returns Promise - */ - public encrypt(request: google.cloud.kms.v1.IEncryptRequest): Promise; + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { - /** - * Calls Decrypt. - * @param request DecryptRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DecryptResponse - */ - public decrypt(request: google.cloud.kms.v1.IDecryptRequest, callback: google.cloud.kms.v1.KeyManagementService.DecryptCallback): void; + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - /** - * Calls Decrypt. - * @param request DecryptRequest message or plain object - * @returns Promise - */ - public decrypt(request: google.cloud.kms.v1.IDecryptRequest): Promise; + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } - /** - * Calls AsymmetricSign. - * @param request AsymmetricSignRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AsymmetricSignResponse - */ - public asymmetricSign(request: google.cloud.kms.v1.IAsymmetricSignRequest, callback: google.cloud.kms.v1.KeyManagementService.AsymmetricSignCallback): void; + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { - /** - * Calls AsymmetricSign. - * @param request AsymmetricSignRequest message or plain object - * @returns Promise - */ - public asymmetricSign(request: google.cloud.kms.v1.IAsymmetricSignRequest): Promise; + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); - /** - * Calls AsymmetricDecrypt. - * @param request AsymmetricDecryptRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AsymmetricDecryptResponse - */ - public asymmetricDecrypt(request: google.cloud.kms.v1.IAsymmetricDecryptRequest, callback: google.cloud.kms.v1.KeyManagementService.AsymmetricDecryptCallback): void; + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; - /** - * Calls AsymmetricDecrypt. - * @param request AsymmetricDecryptRequest message or plain object - * @returns Promise - */ - public asymmetricDecrypt(request: google.cloud.kms.v1.IAsymmetricDecryptRequest): Promise; + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - /** - * Calls UpdateCryptoKeyPrimaryVersion. - * @param request UpdateCryptoKeyPrimaryVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKey - */ - public updateCryptoKeyPrimaryVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersionCallback): void; + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - /** - * Calls UpdateCryptoKeyPrimaryVersion. - * @param request UpdateCryptoKeyPrimaryVersionRequest message or plain object - * @returns Promise - */ - public updateCryptoKeyPrimaryVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest): Promise; + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls DestroyCryptoKeyVersion. - * @param request DestroyCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public destroyCryptoKeyVersion(request: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersionCallback): void; + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls DestroyCryptoKeyVersion. - * @param request DestroyCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public destroyCryptoKeyVersion(request: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest): Promise; + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - /** - * Calls RestoreCryptoKeyVersion. - * @param request RestoreCryptoKeyVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion - */ - public restoreCryptoKeyVersion(request: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersionCallback): void; + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - /** - * Calls RestoreCryptoKeyVersion. - * @param request RestoreCryptoKeyVersionRequest message or plain object - * @returns Promise - */ - public restoreCryptoKeyVersion(request: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest): Promise; - } + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace KeyManagementService { + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listKeyRings}. - * @param error Error, if any - * @param [response] ListKeyRingsResponse - */ - type ListKeyRingsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListKeyRingsResponse) => void; + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeys}. - * @param error Error, if any - * @param [response] ListCryptoKeysResponse - */ - type ListCryptoKeysCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListCryptoKeysResponse) => void; + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeyVersions}. - * @param error Error, if any - * @param [response] ListCryptoKeyVersionsResponse - */ - type ListCryptoKeyVersionsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListCryptoKeyVersionsResponse) => void; + /** Properties of a BindingDelta. */ + interface IBindingDelta { - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listImportJobs}. - * @param error Error, if any - * @param [response] ListImportJobsResponse - */ - type ListImportJobsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListImportJobsResponse) => void; + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getKeyRing}. - * @param error Error, if any - * @param [response] KeyRing - */ - type GetKeyRingCallback = (error: (Error|null), response?: google.cloud.kms.v1.KeyRing) => void; + /** BindingDelta role */ + role?: (string|null); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKey}. - * @param error Error, if any - * @param [response] CryptoKey - */ - type GetCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; + /** BindingDelta member */ + member?: (string|null); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type GetCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getPublicKey}. - * @param error Error, if any - * @param [response] PublicKey - */ - type GetPublicKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.PublicKey) => void; + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getImportJob}. - * @param error Error, if any - * @param [response] ImportJob - */ - type GetImportJobCallback = (error: (Error|null), response?: google.cloud.kms.v1.ImportJob) => void; + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createKeyRing}. - * @param error Error, if any - * @param [response] KeyRing - */ - type CreateKeyRingCallback = (error: (Error|null), response?: google.cloud.kms.v1.KeyRing) => void; + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKey}. - * @param error Error, if any - * @param [response] CryptoKey - */ - type CreateCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; + /** BindingDelta role. */ + public role: string; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type CreateCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** BindingDelta member. */ + public member: string; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#importCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type ImportCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createImportJob}. - * @param error Error, if any - * @param [response] ImportJob - */ - type CreateImportJobCallback = (error: (Error|null), response?: google.cloud.kms.v1.ImportJob) => void; + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKey}. - * @param error Error, if any - * @param [response] CryptoKey - */ - type UpdateCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type UpdateCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#encrypt}. - * @param error Error, if any - * @param [response] EncryptResponse - */ - type EncryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.EncryptResponse) => void; + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#decrypt}. - * @param error Error, if any - * @param [response] DecryptResponse - */ - type DecryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.DecryptResponse) => void; + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricSign}. - * @param error Error, if any - * @param [response] AsymmetricSignResponse - */ - type AsymmetricSignCallback = (error: (Error|null), response?: google.cloud.kms.v1.AsymmetricSignResponse) => void; + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricDecrypt}. - * @param error Error, if any - * @param [response] AsymmetricDecryptResponse - */ - type AsymmetricDecryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.AsymmetricDecryptResponse) => void; + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyPrimaryVersion}. - * @param error Error, if any - * @param [response] CryptoKey - */ - type UpdateCryptoKeyPrimaryVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#destroyCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type DestroyCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BindingDelta { - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#restoreCryptoKeyVersion}. - * @param error Error, if any - * @param [response] CryptoKeyVersion - */ - type RestoreCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 } + } - /** Properties of a ListKeyRingsRequest. */ - interface IListKeyRingsRequest { + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { - /** ListKeyRingsRequest parent */ - parent?: (string|null); + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - /** ListKeyRingsRequest pageSize */ - pageSize?: (number|null); + /** AuditConfigDelta service */ + service?: (string|null); - /** ListKeyRingsRequest pageToken */ - pageToken?: (string|null); + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); - /** ListKeyRingsRequest filter */ - filter?: (string|null); + /** AuditConfigDelta logType */ + logType?: (string|null); + } - /** ListKeyRingsRequest orderBy */ - orderBy?: (string|null); - } + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { - /** Represents a ListKeyRingsRequest. */ - class ListKeyRingsRequest implements IListKeyRingsRequest { + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); - /** - * Constructs a new ListKeyRingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListKeyRingsRequest); + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - /** ListKeyRingsRequest parent. */ - public parent: string; + /** AuditConfigDelta service. */ + public service: string; - /** ListKeyRingsRequest pageSize. */ - public pageSize: number; + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; - /** ListKeyRingsRequest pageToken. */ - public pageToken: string; + /** AuditConfigDelta logType. */ + public logType: string; - /** ListKeyRingsRequest filter. */ - public filter: string; + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - /** ListKeyRingsRequest orderBy. */ - public orderBy: string; + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new ListKeyRingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListKeyRingsRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IListKeyRingsRequest): google.cloud.kms.v1.ListKeyRingsRequest; + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListKeyRingsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. - * @param message ListKeyRingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListKeyRingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - /** - * Encodes the specified ListKeyRingsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. - * @param message ListKeyRingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListKeyRingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - /** - * Decodes a ListKeyRingsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListKeyRingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListKeyRingsRequest; + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a ListKeyRingsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListKeyRingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListKeyRingsRequest; + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - /** - * Verifies a ListKeyRingsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a ListKeyRingsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListKeyRingsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListKeyRingsRequest; + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a ListKeyRingsRequest message. Also converts values to other types if specified. - * @param message ListKeyRingsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListKeyRingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace AuditConfigDelta { - /** - * Converts this ListKeyRingsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 } + } - /** Properties of a ListCryptoKeysRequest. */ - interface IListCryptoKeysRequest { - - /** ListCryptoKeysRequest parent */ - parent?: (string|null); - - /** ListCryptoKeysRequest pageSize */ - pageSize?: (number|null); + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { - /** ListCryptoKeysRequest pageToken */ - pageToken?: (string|null); + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } - /** ListCryptoKeysRequest versionView */ - versionView?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null); + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { - /** ListCryptoKeysRequest filter */ - filter?: (string|null); + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); - /** ListCryptoKeysRequest orderBy */ - orderBy?: (string|null); - } + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; - /** Represents a ListCryptoKeysRequest. */ - class ListCryptoKeysRequest implements IListCryptoKeysRequest { + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - /** - * Constructs a new ListCryptoKeysRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListCryptoKeysRequest); + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListCryptoKeysRequest parent. */ - public parent: string; + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListCryptoKeysRequest pageSize. */ - public pageSize: number; + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - /** ListCryptoKeysRequest pageToken. */ - public pageToken: string; + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - /** ListCryptoKeysRequest versionView. */ - public versionView: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView); + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListCryptoKeysRequest filter. */ - public filter: string; + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - /** ListCryptoKeysRequest orderBy. */ - public orderBy: string; + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new ListCryptoKeysRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCryptoKeysRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IListCryptoKeysRequest): google.cloud.kms.v1.ListCryptoKeysRequest; + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ListCryptoKeysRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. - * @param message ListCryptoKeysRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListCryptoKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { - /** - * Encodes the specified ListCryptoKeysRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. - * @param message ListCryptoKeysRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** - * Decodes a ListCryptoKeysRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCryptoKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeysRequest; + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - /** - * Decodes a ListCryptoKeysRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCryptoKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeysRequest; + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - /** - * Verifies a ListCryptoKeysRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - /** - * Creates a ListCryptoKeysRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCryptoKeysRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeysRequest; + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - /** - * Creates a plain object from a ListCryptoKeysRequest message. Also converts values to other types if specified. - * @param message ListCryptoKeysRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListCryptoKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - /** - * Converts this ListCryptoKeysRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - /** Properties of a ListCryptoKeyVersionsRequest. */ - interface IListCryptoKeyVersionsRequest { + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } - /** ListCryptoKeyVersionsRequest parent */ - parent?: (string|null); + namespace IAMPolicy { - /** ListCryptoKeyVersionsRequest pageSize */ - pageSize?: (number|null); + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - /** ListCryptoKeyVersionsRequest pageToken */ - pageToken?: (string|null); + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - /** ListCryptoKeyVersionsRequest view */ - view?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null); + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } - /** ListCryptoKeyVersionsRequest filter */ - filter?: (string|null); + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { - /** ListCryptoKeyVersionsRequest orderBy */ - orderBy?: (string|null); - } + /** SetIamPolicyRequest resource */ + resource?: (string|null); - /** Represents a ListCryptoKeyVersionsRequest. */ - class ListCryptoKeyVersionsRequest implements IListCryptoKeyVersionsRequest { + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + } - /** - * Constructs a new ListCryptoKeyVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsRequest); + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { - /** ListCryptoKeyVersionsRequest parent. */ - public parent: string; + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - /** ListCryptoKeyVersionsRequest pageSize. */ - public pageSize: number; + /** SetIamPolicyRequest resource. */ + public resource: string; - /** ListCryptoKeyVersionsRequest pageToken. */ - public pageToken: string; + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); - /** ListCryptoKeyVersionsRequest view. */ - public view: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView); + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - /** ListCryptoKeyVersionsRequest filter. */ - public filter: string; + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListCryptoKeyVersionsRequest orderBy. */ - public orderBy: string; + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new ListCryptoKeyVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCryptoKeyVersionsRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsRequest): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - /** - * Encodes the specified ListCryptoKeyVersionsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. - * @param message ListCryptoKeyVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - /** - * Encodes the specified ListCryptoKeyVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. - * @param message ListCryptoKeyVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCryptoKeyVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - /** - * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCryptoKeyVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a ListCryptoKeyVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a ListCryptoKeyVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCryptoKeyVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { - /** - * Creates a plain object from a ListCryptoKeyVersionsRequest message. Also converts values to other types if specified. - * @param message ListCryptoKeyVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListCryptoKeyVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** GetIamPolicyRequest resource */ + resource?: (string|null); - /** - * Converts this ListCryptoKeyVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } - /** Properties of a ListImportJobsRequest. */ - interface IListImportJobsRequest { + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { - /** ListImportJobsRequest parent */ - parent?: (string|null); + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - /** ListImportJobsRequest pageSize */ - pageSize?: (number|null); + /** GetIamPolicyRequest resource. */ + public resource: string; - /** ListImportJobsRequest pageToken */ - pageToken?: (string|null); + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); - /** ListImportJobsRequest filter */ - filter?: (string|null); + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - /** ListImportJobsRequest orderBy */ - orderBy?: (string|null); - } + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListImportJobsRequest. */ - class ListImportJobsRequest implements IListImportJobsRequest { + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ListImportJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListImportJobsRequest); + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - /** ListImportJobsRequest parent. */ - public parent: string; + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - /** ListImportJobsRequest pageSize. */ - public pageSize: number; + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListImportJobsRequest pageToken. */ - public pageToken: string; + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - /** ListImportJobsRequest filter. */ - public filter: string; + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListImportJobsRequest orderBy. */ - public orderBy: string; + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new ListImportJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListImportJobsRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IListImportJobsRequest): google.cloud.kms.v1.ListImportJobsRequest; + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { - /** - * Encodes the specified ListImportJobsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. - * @param message ListImportJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListImportJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** TestIamPermissionsRequest resource */ + resource?: (string|null); - /** - * Encodes the specified ListImportJobsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. - * @param message ListImportJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListImportJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } - /** - * Decodes a ListImportJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListImportJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListImportJobsRequest; + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - /** - * Decodes a ListImportJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListImportJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListImportJobsRequest; + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - /** - * Verifies a ListImportJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** TestIamPermissionsRequest resource. */ + public resource: string; - /** - * Creates a ListImportJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListImportJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListImportJobsRequest; + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - /** - * Creates a plain object from a ListImportJobsRequest message. Also converts values to other types if specified. - * @param message ListImportJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListImportJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ListImportJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ListKeyRingsResponse. */ - interface IListKeyRingsResponse { + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - /** ListKeyRingsResponse keyRings */ - keyRings?: (google.cloud.kms.v1.IKeyRing[]|null); + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - /** ListKeyRingsResponse nextPageToken */ - nextPageToken?: (string|null); + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListKeyRingsResponse totalSize */ - totalSize?: (number|null); - } + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - /** Represents a ListKeyRingsResponse. */ - class ListKeyRingsResponse implements IListKeyRingsResponse { + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new ListKeyRingsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListKeyRingsResponse); + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListKeyRingsResponse keyRings. */ - public keyRings: google.cloud.kms.v1.IKeyRing[]; + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { - /** ListKeyRingsResponse nextPageToken. */ - public nextPageToken: string; + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } - /** ListKeyRingsResponse totalSize. */ - public totalSize: number; + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - /** - * Creates a new ListKeyRingsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListKeyRingsResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IListKeyRingsResponse): google.cloud.kms.v1.ListKeyRingsResponse; + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - /** - * Encodes the specified ListKeyRingsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. - * @param message ListKeyRingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListKeyRingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; - /** - * Encodes the specified ListKeyRingsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. - * @param message ListKeyRingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListKeyRingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - /** - * Decodes a ListKeyRingsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListKeyRingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListKeyRingsResponse; + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListKeyRingsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListKeyRingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListKeyRingsResponse; + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ListKeyRingsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - /** - * Creates a ListKeyRingsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListKeyRingsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListKeyRingsResponse; + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - /** - * Creates a plain object from a ListKeyRingsResponse message. Also converts values to other types if specified. - * @param message ListKeyRingsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListKeyRingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this ListKeyRingsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - /** Properties of a ListCryptoKeysResponse. */ - interface IListCryptoKeysResponse { + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListCryptoKeysResponse cryptoKeys */ - cryptoKeys?: (google.cloud.kms.v1.ICryptoKey[]|null); + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListCryptoKeysResponse nextPageToken */ - nextPageToken?: (string|null); + /** Namespace logging. */ + namespace logging { - /** ListCryptoKeysResponse totalSize */ - totalSize?: (number|null); + /** Properties of an AuditData. */ + interface IAuditData { + + /** AuditData policyDelta */ + policyDelta?: (google.iam.v1.IPolicyDelta|null); } - /** Represents a ListCryptoKeysResponse. */ - class ListCryptoKeysResponse implements IListCryptoKeysResponse { + /** Represents an AuditData. */ + class AuditData implements IAuditData { /** - * Constructs a new ListCryptoKeysResponse. + * Constructs a new AuditData. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.kms.v1.IListCryptoKeysResponse); - - /** ListCryptoKeysResponse cryptoKeys. */ - public cryptoKeys: google.cloud.kms.v1.ICryptoKey[]; - - /** ListCryptoKeysResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.iam.v1.logging.IAuditData); - /** ListCryptoKeysResponse totalSize. */ - public totalSize: number; + /** AuditData policyDelta. */ + public policyDelta?: (google.iam.v1.IPolicyDelta|null); /** - * Creates a new ListCryptoKeysResponse instance using the specified properties. + * Creates a new AuditData instance using the specified properties. * @param [properties] Properties to set - * @returns ListCryptoKeysResponse instance + * @returns AuditData instance */ - public static create(properties?: google.cloud.kms.v1.IListCryptoKeysResponse): google.cloud.kms.v1.ListCryptoKeysResponse; + public static create(properties?: google.iam.v1.logging.IAuditData): google.iam.v1.logging.AuditData; /** - * Encodes the specified ListCryptoKeysResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. - * @param message ListCryptoKeysResponse message or plain object to encode + * Encodes the specified AuditData message. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. + * @param message AuditData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.kms.v1.IListCryptoKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.logging.IAuditData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCryptoKeysResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. - * @param message ListCryptoKeysResponse message or plain object to encode + * Encodes the specified AuditData message, length delimited. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. + * @param message AuditData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.logging.IAuditData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCryptoKeysResponse message from the specified reader or buffer. + * Decodes an AuditData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCryptoKeysResponse + * @returns AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeysResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.logging.AuditData; /** - * Decodes a ListCryptoKeysResponse message from the specified reader or buffer, length delimited. + * Decodes an AuditData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCryptoKeysResponse + * @returns AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeysResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.logging.AuditData; /** - * Verifies a ListCryptoKeysResponse message. + * Verifies an AuditData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListCryptoKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AuditData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCryptoKeysResponse + * @returns AuditData */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeysResponse; + public static fromObject(object: { [k: string]: any }): google.iam.v1.logging.AuditData; /** - * Creates a plain object from a ListCryptoKeysResponse message. Also converts values to other types if specified. - * @param message ListCryptoKeysResponse + * Creates a plain object from an AuditData message. Also converts values to other types if specified. + * @param message AuditData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.kms.v1.ListCryptoKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.logging.AuditData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCryptoKeysResponse to JSON. + * Converts this AuditData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } + } + } - /** Properties of a ListCryptoKeyVersionsResponse. */ - interface IListCryptoKeyVersionsResponse { + /** Namespace type. */ + namespace type { - /** ListCryptoKeyVersionsResponse cryptoKeyVersions */ - cryptoKeyVersions?: (google.cloud.kms.v1.ICryptoKeyVersion[]|null); + /** Properties of an Expr. */ + interface IExpr { - /** ListCryptoKeyVersionsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Expr expression */ + expression?: (string|null); - /** ListCryptoKeyVersionsResponse totalSize */ - totalSize?: (number|null); - } + /** Expr title */ + title?: (string|null); - /** Represents a ListCryptoKeyVersionsResponse. */ - class ListCryptoKeyVersionsResponse implements IListCryptoKeyVersionsResponse { + /** Expr description */ + description?: (string|null); - /** - * Constructs a new ListCryptoKeyVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsResponse); + /** Expr location */ + location?: (string|null); + } - /** ListCryptoKeyVersionsResponse cryptoKeyVersions. */ - public cryptoKeyVersions: google.cloud.kms.v1.ICryptoKeyVersion[]; + /** Represents an Expr. */ + class Expr implements IExpr { - /** ListCryptoKeyVersionsResponse nextPageToken. */ - public nextPageToken: string; + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); - /** ListCryptoKeyVersionsResponse totalSize. */ - public totalSize: number; + /** Expr expression. */ + public expression: string; - /** - * Creates a new ListCryptoKeyVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCryptoKeyVersionsResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsResponse): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; + /** Expr title. */ + public title: string; - /** - * Encodes the specified ListCryptoKeyVersionsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. - * @param message ListCryptoKeyVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListCryptoKeyVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Expr description. */ + public description: string; - /** - * Encodes the specified ListCryptoKeyVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. - * @param message ListCryptoKeyVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeyVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Expr location. */ + public location: string; - /** - * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCryptoKeyVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCryptoKeyVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a ListCryptoKeyVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a HttpRule. */ + interface IHttpRule { - /** - * Creates a ListCryptoKeyVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCryptoKeyVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; + /** HttpRule selector */ + selector?: (string|null); - /** - * Creates a plain object from a ListCryptoKeyVersionsResponse message. Also converts values to other types if specified. - * @param message ListCryptoKeyVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListCryptoKeyVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** HttpRule get */ + get?: (string|null); - /** - * Converts this ListCryptoKeyVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** HttpRule put */ + put?: (string|null); - /** Properties of a ListImportJobsResponse. */ - interface IListImportJobsResponse { + /** HttpRule post */ + post?: (string|null); - /** ListImportJobsResponse importJobs */ - importJobs?: (google.cloud.kms.v1.IImportJob[]|null); + /** HttpRule delete */ + "delete"?: (string|null); - /** ListImportJobsResponse nextPageToken */ - nextPageToken?: (string|null); + /** HttpRule patch */ + patch?: (string|null); - /** ListImportJobsResponse totalSize */ - totalSize?: (number|null); - } + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** Represents a ListImportJobsResponse. */ - class ListImportJobsResponse implements IListImportJobsResponse { + /** HttpRule body */ + body?: (string|null); - /** - * Constructs a new ListImportJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IListImportJobsResponse); + /** HttpRule responseBody */ + responseBody?: (string|null); - /** ListImportJobsResponse importJobs. */ - public importJobs: google.cloud.kms.v1.IImportJob[]; + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } - /** ListImportJobsResponse nextPageToken. */ - public nextPageToken: string; + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { - /** ListImportJobsResponse totalSize. */ - public totalSize: number; + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); - /** - * Creates a new ListImportJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListImportJobsResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IListImportJobsResponse): google.cloud.kms.v1.ListImportJobsResponse; + /** HttpRule selector. */ + public selector: string; - /** - * Encodes the specified ListImportJobsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. - * @param message ListImportJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IListImportJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule get. */ + public get: string; - /** - * Encodes the specified ListImportJobsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. - * @param message ListImportJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IListImportJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule put. */ + public put: string; - /** - * Decodes a ListImportJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListImportJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListImportJobsResponse; + /** HttpRule post. */ + public post: string; - /** - * Decodes a ListImportJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListImportJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListImportJobsResponse; + /** HttpRule delete. */ + public delete: string; - /** - * Verifies a ListImportJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** HttpRule patch. */ + public patch: string; - /** - * Creates a ListImportJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListImportJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListImportJobsResponse; + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); - /** - * Creates a plain object from a ListImportJobsResponse message. Also converts values to other types if specified. - * @param message ListImportJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ListImportJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** HttpRule body. */ + public body: string; - /** - * Converts this ListImportJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** HttpRule responseBody. */ + public responseBody: string; - /** Properties of a GetKeyRingRequest. */ - interface IGetKeyRingRequest { + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; - /** GetKeyRingRequest name */ - name?: (string|null); - } + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - /** Represents a GetKeyRingRequest. */ - class GetKeyRingRequest implements IGetKeyRingRequest { + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - /** - * Constructs a new GetKeyRingRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IGetKeyRingRequest); + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** GetKeyRingRequest name. */ - public name: string; + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new GetKeyRingRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetKeyRingRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IGetKeyRingRequest): google.cloud.kms.v1.GetKeyRingRequest; + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - /** - * Encodes the specified GetKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. - * @param message GetKeyRingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IGetKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - /** - * Encodes the specified GetKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. - * @param message GetKeyRingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IGetKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a GetKeyRingRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetKeyRingRequest; + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - /** - * Decodes a GetKeyRingRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetKeyRingRequest; + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a GetKeyRingRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a GetKeyRingRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetKeyRingRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetKeyRingRequest; + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** - * Creates a plain object from a GetKeyRingRequest message. Also converts values to other types if specified. - * @param message GetKeyRingRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.GetKeyRingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CustomHttpPattern kind */ + kind?: (string|null); - /** - * Converts this GetKeyRingRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** CustomHttpPattern path */ + path?: (string|null); + } - /** Properties of a GetCryptoKeyRequest. */ - interface IGetCryptoKeyRequest { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { - /** GetCryptoKeyRequest name */ - name?: (string|null); - } + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); - /** Represents a GetCryptoKeyRequest. */ - class GetCryptoKeyRequest implements IGetCryptoKeyRequest { + /** CustomHttpPattern kind. */ + public kind: string; - /** - * Constructs a new GetCryptoKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IGetCryptoKeyRequest); + /** CustomHttpPattern path. */ + public path: string; - /** GetCryptoKeyRequest name. */ - public name: string; + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - /** - * Creates a new GetCryptoKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCryptoKeyRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IGetCryptoKeyRequest): google.cloud.kms.v1.GetCryptoKeyRequest; + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GetCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. - * @param message GetCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IGetCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GetCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. - * @param message GetCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IGetCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - /** - * Decodes a GetCryptoKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetCryptoKeyRequest; + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - /** - * Decodes a GetCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetCryptoKeyRequest; + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a GetCryptoKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - /** - * Creates a GetCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCryptoKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetCryptoKeyRequest; + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a GetCryptoKeyRequest message. Also converts values to other types if specified. - * @param message GetCryptoKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.GetCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this GetCryptoKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } - /** Properties of a GetCryptoKeyVersionRequest. */ - interface IGetCryptoKeyVersionRequest { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** GetCryptoKeyVersionRequest name */ - name?: (string|null); - } + /** ResourceDescriptor type */ + type?: (string|null); - /** Represents a GetCryptoKeyVersionRequest. */ - class GetCryptoKeyVersionRequest implements IGetCryptoKeyVersionRequest { + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** - * Constructs a new GetCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IGetCryptoKeyVersionRequest); + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** GetCryptoKeyVersionRequest name. */ - public name: string; + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); - /** - * Creates a new GetCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IGetCryptoKeyVersionRequest): google.cloud.kms.v1.GetCryptoKeyVersionRequest; + /** ResourceDescriptor singular */ + singular?: (string|null); + } - /** - * Encodes the specified GetCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. - * @param message GetCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { - /** - * Encodes the specified GetCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. - * @param message GetCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); - /** - * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetCryptoKeyVersionRequest; + /** ResourceDescriptor type. */ + public type: string; - /** - * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetCryptoKeyVersionRequest; + /** ResourceDescriptor pattern. */ + public pattern: string[]; - /** - * Verifies a GetCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ResourceDescriptor nameField. */ + public nameField: string; - /** - * Creates a GetCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetCryptoKeyVersionRequest; + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - /** - * Creates a plain object from a GetCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message GetCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.GetCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ResourceDescriptor plural. */ + public plural: string; - /** - * Converts this GetCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ResourceDescriptor singular. */ + public singular: string; - /** Properties of a GetPublicKeyRequest. */ - interface IGetPublicKeyRequest { + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - /** GetPublicKeyRequest name */ - name?: (string|null); - } + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a GetPublicKeyRequest. */ - class GetPublicKeyRequest implements IGetPublicKeyRequest { + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new GetPublicKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IGetPublicKeyRequest); + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - /** GetPublicKeyRequest name. */ - public name: string; + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - /** - * Creates a new GetPublicKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPublicKeyRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IGetPublicKeyRequest): google.cloud.kms.v1.GetPublicKeyRequest; + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified GetPublicKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. - * @param message GetPublicKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IGetPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - /** - * Encodes the specified GetPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. - * @param message GetPublicKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IGetPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a GetPublicKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPublicKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetPublicKeyRequest; + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a GetPublicKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPublicKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetPublicKeyRequest; + namespace ResourceDescriptor { - /** - * Verifies a GetPublicKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } - /** - * Creates a GetPublicKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPublicKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetPublicKeyRequest; + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** - * Creates a plain object from a GetPublicKeyRequest message. Also converts values to other types if specified. - * @param message GetPublicKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.GetPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ResourceReference type */ + type?: (string|null); - /** - * Converts this GetPublicKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ResourceReference childType */ + childType?: (string|null); + } - /** Properties of a GetImportJobRequest. */ - interface IGetImportJobRequest { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { - /** GetImportJobRequest name */ - name?: (string|null); - } + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); - /** Represents a GetImportJobRequest. */ - class GetImportJobRequest implements IGetImportJobRequest { + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; - /** - * Constructs a new GetImportJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IGetImportJobRequest); + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - /** GetImportJobRequest name. */ - public name: string; + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new GetImportJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetImportJobRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IGetImportJobRequest): google.cloud.kms.v1.GetImportJobRequest; + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GetImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. - * @param message GetImportJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IGetImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - /** - * Encodes the specified GetImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. - * @param message GetImportJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IGetImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - /** - * Decodes a GetImportJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetImportJobRequest; + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a GetImportJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetImportJobRequest; + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - /** - * Verifies a GetImportJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a GetImportJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetImportJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetImportJobRequest; + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Creates a plain object from a GetImportJobRequest message. Also converts values to other types if specified. - * @param message GetImportJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.GetImportJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Namespace protobuf. */ + namespace protobuf { - /** - * Converts this GetImportJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** Properties of a CreateKeyRingRequest. */ - interface ICreateKeyRingRequest { + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } - /** CreateKeyRingRequest parent */ - parent?: (string|null); + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { - /** CreateKeyRingRequest keyRingId */ - keyRingId?: (string|null); + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** CreateKeyRingRequest keyRing */ - keyRing?: (google.cloud.kms.v1.IKeyRing|null); - } + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; - /** Represents a CreateKeyRingRequest. */ - class CreateKeyRingRequest implements ICreateKeyRingRequest { + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - /** - * Constructs a new CreateKeyRingRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICreateKeyRingRequest); + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateKeyRingRequest parent. */ - public parent: string; + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateKeyRingRequest keyRingId. */ - public keyRingId: string; + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - /** CreateKeyRingRequest keyRing. */ - public keyRing?: (google.cloud.kms.v1.IKeyRing|null); + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - /** - * Creates a new CreateKeyRingRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateKeyRingRequest instance - */ - public static create(properties?: google.cloud.kms.v1.ICreateKeyRingRequest): google.cloud.kms.v1.CreateKeyRingRequest; + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified CreateKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. - * @param message CreateKeyRingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICreateKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - /** - * Encodes the specified CreateKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. - * @param message CreateKeyRingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICreateKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a CreateKeyRingRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateKeyRingRequest; + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a CreateKeyRingRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateKeyRingRequest; + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** - * Verifies a CreateKeyRingRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileDescriptorProto name */ + name?: (string|null); - /** - * Creates a CreateKeyRingRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateKeyRingRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateKeyRingRequest; + /** FileDescriptorProto package */ + "package"?: (string|null); - /** - * Creates a plain object from a CreateKeyRingRequest message. Also converts values to other types if specified. - * @param message CreateKeyRingRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CreateKeyRingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); - /** - * Converts this CreateKeyRingRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); - /** Properties of a CreateCryptoKeyRequest. */ - interface ICreateCryptoKeyRequest { + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); - /** CreateCryptoKeyRequest parent */ - parent?: (string|null); + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); - /** CreateCryptoKeyRequest cryptoKeyId */ - cryptoKeyId?: (string|null); + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** CreateCryptoKeyRequest cryptoKey */ - cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); - /** CreateCryptoKeyRequest skipInitialVersionCreation */ - skipInitialVersionCreation?: (boolean|null); - } + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** Represents a CreateCryptoKeyRequest. */ - class CreateCryptoKeyRequest implements ICreateCryptoKeyRequest { + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); - /** - * Constructs a new CreateCryptoKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICreateCryptoKeyRequest); + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** CreateCryptoKeyRequest parent. */ - public parent: string; + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } - /** CreateCryptoKeyRequest cryptoKeyId. */ - public cryptoKeyId: string; + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { - /** CreateCryptoKeyRequest cryptoKey. */ - public cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** CreateCryptoKeyRequest skipInitialVersionCreation. */ - public skipInitialVersionCreation: boolean; + /** FileDescriptorProto name. */ + public name: string; - /** - * Creates a new CreateCryptoKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCryptoKeyRequest instance - */ - public static create(properties?: google.cloud.kms.v1.ICreateCryptoKeyRequest): google.cloud.kms.v1.CreateCryptoKeyRequest; + /** FileDescriptorProto package. */ + public package: string; - /** - * Encodes the specified CreateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. - * @param message CreateCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICreateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto dependency. */ + public dependency: string[]; - /** - * Encodes the specified CreateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. - * @param message CreateCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICreateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; - /** - * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateCryptoKeyRequest; + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; - /** - * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateCryptoKeyRequest; + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; - /** - * Verifies a CreateCryptoKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** - * Creates a CreateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCryptoKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateCryptoKeyRequest; + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; - /** - * Creates a plain object from a CreateCryptoKeyRequest message. Also converts values to other types if specified. - * @param message CreateCryptoKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CreateCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Converts this CreateCryptoKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); - /** Properties of a CreateCryptoKeyVersionRequest. */ - interface ICreateCryptoKeyVersionRequest { + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** CreateCryptoKeyVersionRequest parent */ - parent?: (string|null); + /** FileDescriptorProto syntax. */ + public syntax: string; - /** CreateCryptoKeyVersionRequest cryptoKeyVersion */ - cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - } + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - /** Represents a CreateCryptoKeyVersionRequest. */ - class CreateCryptoKeyVersionRequest implements ICreateCryptoKeyVersionRequest { + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new CreateCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest); + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateCryptoKeyVersionRequest parent. */ - public parent: string; + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - /** CreateCryptoKeyVersionRequest cryptoKeyVersion. */ - public cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - /** - * Creates a new CreateCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - /** - * Encodes the specified CreateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. - * @param message CreateCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified CreateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. - * @param message CreateCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** - * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; + /** DescriptorProto name */ + name?: (string|null); - /** - * Verifies a CreateCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); - /** - * Creates a CreateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** - * Creates a plain object from a CreateCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message CreateCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CreateCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); - /** - * Converts this CreateCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** Properties of an ImportCryptoKeyVersionRequest. */ - interface IImportCryptoKeyVersionRequest { + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - /** ImportCryptoKeyVersionRequest parent */ - parent?: (string|null); + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - /** ImportCryptoKeyVersionRequest algorithm */ - algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); - /** ImportCryptoKeyVersionRequest importJob */ - importJob?: (string|null); + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - /** ImportCryptoKeyVersionRequest rsaAesWrappedKey */ - rsaAesWrappedKey?: (Uint8Array|string|null); - } + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** Represents an ImportCryptoKeyVersionRequest. */ - class ImportCryptoKeyVersionRequest implements IImportCryptoKeyVersionRequest { + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { - /** - * Constructs a new ImportCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IImportCryptoKeyVersionRequest); + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); - /** ImportCryptoKeyVersionRequest parent. */ - public parent: string; + /** DescriptorProto name. */ + public name: string; - /** ImportCryptoKeyVersionRequest algorithm. */ - public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; - /** ImportCryptoKeyVersionRequest importJob. */ - public importJob: string; + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** ImportCryptoKeyVersionRequest rsaAesWrappedKey. */ - public rsaAesWrappedKey: (Uint8Array|string); + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; - /** ImportCryptoKeyVersionRequest wrappedKeyMaterial. */ - public wrappedKeyMaterial?: "rsaAesWrappedKey"; + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** - * Creates a new ImportCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IImportCryptoKeyVersionRequest): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - /** - * Encodes the specified ImportCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. - * @param message ImportCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - /** - * Encodes the specified ImportCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. - * @param message ImportCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); - /** - * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - /** - * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; + /** DescriptorProto reservedName. */ + public reservedName: string[]; - /** - * Verifies an ImportCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - /** - * Creates an ImportCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an ImportCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message ImportCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ImportCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ImportCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - /** Properties of a CreateImportJobRequest. */ - interface ICreateImportJobRequest { + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - /** CreateImportJobRequest parent */ - parent?: (string|null); + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CreateImportJobRequest importJobId */ - importJobId?: (string|null); + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - /** CreateImportJobRequest importJob */ - importJob?: (google.cloud.kms.v1.IImportJob|null); - } + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a CreateImportJobRequest. */ - class CreateImportJobRequest implements ICreateImportJobRequest { + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new CreateImportJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICreateImportJobRequest); + namespace DescriptorProto { - /** CreateImportJobRequest parent. */ - public parent: string; + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** CreateImportJobRequest importJobId. */ - public importJobId: string; + /** ExtensionRange start */ + start?: (number|null); - /** CreateImportJobRequest importJob. */ - public importJob?: (google.cloud.kms.v1.IImportJob|null); + /** ExtensionRange end */ + end?: (number|null); - /** - * Creates a new CreateImportJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateImportJobRequest instance - */ - public static create(properties?: google.cloud.kms.v1.ICreateImportJobRequest): google.cloud.kms.v1.CreateImportJobRequest; + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } - /** - * Encodes the specified CreateImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. - * @param message CreateImportJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICreateImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { - /** - * Encodes the specified CreateImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. - * @param message CreateImportJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICreateImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** - * Decodes a CreateImportJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateImportJobRequest; + /** ExtensionRange start. */ + public start: number; - /** - * Decodes a CreateImportJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateImportJobRequest; + /** ExtensionRange end. */ + public end: number; - /** - * Verifies a CreateImportJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); - /** - * Creates a CreateImportJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateImportJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateImportJobRequest; + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - /** - * Creates a plain object from a CreateImportJobRequest message. Also converts values to other types if specified. - * @param message CreateImportJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CreateImportJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this CreateImportJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an UpdateCryptoKeyRequest. */ - interface IUpdateCryptoKeyRequest { + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - /** UpdateCryptoKeyRequest cryptoKey */ - cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - /** UpdateCryptoKeyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents an UpdateCryptoKeyRequest. */ - class UpdateCryptoKeyRequest implements IUpdateCryptoKeyRequest { + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - /** - * Constructs a new UpdateCryptoKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyRequest); + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UpdateCryptoKeyRequest cryptoKey. */ - public cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UpdateCryptoKeyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a ReservedRange. */ + interface IReservedRange { - /** - * Creates a new UpdateCryptoKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCryptoKeyRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyRequest): google.cloud.kms.v1.UpdateCryptoKeyRequest; + /** ReservedRange start */ + start?: (number|null); - /** - * Encodes the specified UpdateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. - * @param message UpdateCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReservedRange end */ + end?: (number|null); + } - /** - * Encodes the specified UpdateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. - * @param message UpdateCryptoKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { - /** - * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyRequest; + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** - * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyRequest; + /** ReservedRange start. */ + public start: number; - /** - * Verifies an UpdateCryptoKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ReservedRange end. */ + public end: number; - /** - * Creates an UpdateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCryptoKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyRequest; + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - /** - * Creates a plain object from an UpdateCryptoKeyRequest message. Also converts values to other types if specified. - * @param message UpdateCryptoKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this UpdateCryptoKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an UpdateCryptoKeyVersionRequest. */ - interface IUpdateCryptoKeyVersionRequest { + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - /** UpdateCryptoKeyVersionRequest cryptoKeyVersion */ - cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - /** UpdateCryptoKeyVersionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents an UpdateCryptoKeyVersionRequest. */ - class UpdateCryptoKeyVersionRequest implements IUpdateCryptoKeyVersionRequest { + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - /** - * Constructs a new UpdateCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest); + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UpdateCryptoKeyVersionRequest cryptoKeyVersion. */ - public cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** UpdateCryptoKeyVersionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { - /** - * Creates a new UpdateCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Encodes the specified UpdateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. - * @param message UpdateCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { - /** - * Encodes the specified UpdateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. - * @param message UpdateCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); - /** - * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - /** - * Verifies an UpdateCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an UpdateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an UpdateCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message UpdateCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - /** - * Converts this UpdateCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - /** Properties of an EncryptRequest. */ - interface IEncryptRequest { + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** EncryptRequest name */ - name?: (string|null); + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - /** EncryptRequest plaintext */ - plaintext?: (Uint8Array|string|null); + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EncryptRequest additionalAuthenticatedData */ - additionalAuthenticatedData?: (Uint8Array|string|null); - } + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an EncryptRequest. */ - class EncryptRequest implements IEncryptRequest { + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** - * Constructs a new EncryptRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IEncryptRequest); + /** FieldDescriptorProto name */ + name?: (string|null); - /** EncryptRequest name. */ - public name: string; + /** FieldDescriptorProto number */ + number?: (number|null); - /** EncryptRequest plaintext. */ - public plaintext: (Uint8Array|string); + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - /** EncryptRequest additionalAuthenticatedData. */ - public additionalAuthenticatedData: (Uint8Array|string); + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - /** - * Creates a new EncryptRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IEncryptRequest): google.cloud.kms.v1.EncryptRequest; + /** FieldDescriptorProto typeName */ + typeName?: (string|null); - /** - * Encodes the specified EncryptRequest message. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. - * @param message EncryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IEncryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldDescriptorProto extendee */ + extendee?: (string|null); - /** - * Encodes the specified EncryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. - * @param message EncryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IEncryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); - /** - * Decodes an EncryptRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.EncryptRequest; + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); - /** - * Decodes an EncryptRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.EncryptRequest; + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); - /** - * Verifies an EncryptRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + } - /** - * Creates an EncryptRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.EncryptRequest; + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { - /** - * Creates a plain object from an EncryptRequest message. Also converts values to other types if specified. - * @param message EncryptRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.EncryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** - * Converts this EncryptRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldDescriptorProto name. */ + public name: string; - /** Properties of a DecryptRequest. */ - interface IDecryptRequest { + /** FieldDescriptorProto number. */ + public number: number; - /** DecryptRequest name */ - name?: (string|null); + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - /** DecryptRequest ciphertext */ - ciphertext?: (Uint8Array|string|null); + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - /** DecryptRequest additionalAuthenticatedData */ - additionalAuthenticatedData?: (Uint8Array|string|null); - } + /** FieldDescriptorProto typeName. */ + public typeName: string; - /** Represents a DecryptRequest. */ - class DecryptRequest implements IDecryptRequest { + /** FieldDescriptorProto extendee. */ + public extendee: string; - /** - * Constructs a new DecryptRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IDecryptRequest); + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; - /** DecryptRequest name. */ - public name: string; + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; - /** DecryptRequest ciphertext. */ - public ciphertext: (Uint8Array|string); + /** FieldDescriptorProto jsonName. */ + public jsonName: string; - /** DecryptRequest additionalAuthenticatedData. */ - public additionalAuthenticatedData: (Uint8Array|string); + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); - /** - * Creates a new DecryptRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DecryptRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IDecryptRequest): google.cloud.kms.v1.DecryptRequest; + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - /** - * Encodes the specified DecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. - * @param message DecryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. - * @param message DecryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a DecryptRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DecryptRequest; + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - /** - * Decodes a DecryptRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DecryptRequest; + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - /** - * Verifies a DecryptRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a DecryptRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecryptRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DecryptRequest; + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - /** - * Creates a plain object from a DecryptRequest message. Also converts values to other types if specified. - * @param message DecryptRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.DecryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this DecryptRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an AsymmetricSignRequest. */ - interface IAsymmetricSignRequest { + namespace FieldDescriptorProto { - /** AsymmetricSignRequest name */ - name?: (string|null); + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } - /** AsymmetricSignRequest digest */ - digest?: (google.cloud.kms.v1.IDigest|null); - } + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } - /** Represents an AsymmetricSignRequest. */ - class AsymmetricSignRequest implements IAsymmetricSignRequest { + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { - /** - * Constructs a new AsymmetricSignRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IAsymmetricSignRequest); + /** OneofDescriptorProto name */ + name?: (string|null); - /** AsymmetricSignRequest name. */ - public name: string; + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } - /** AsymmetricSignRequest digest. */ - public digest?: (google.cloud.kms.v1.IDigest|null); + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { - /** - * Creates a new AsymmetricSignRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricSignRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IAsymmetricSignRequest): google.cloud.kms.v1.AsymmetricSignRequest; + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); - /** - * Encodes the specified AsymmetricSignRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. - * @param message AsymmetricSignRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IAsymmetricSignRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** OneofDescriptorProto name. */ + public name: string; - /** - * Encodes the specified AsymmetricSignRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. - * @param message AsymmetricSignRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricSignRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); - /** - * Decodes an AsymmetricSignRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricSignRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricSignRequest; + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - /** - * Decodes an AsymmetricSignRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricSignRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricSignRequest; + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AsymmetricSignRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an AsymmetricSignRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricSignRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricSignRequest; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - /** - * Creates a plain object from an AsymmetricSignRequest message. Also converts values to other types if specified. - * @param message AsymmetricSignRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.AsymmetricSignRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - /** - * Converts this AsymmetricSignRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of an AsymmetricDecryptRequest. */ - interface IAsymmetricDecryptRequest { + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - /** AsymmetricDecryptRequest name */ - name?: (string|null); + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AsymmetricDecryptRequest ciphertext */ - ciphertext?: (Uint8Array|string|null); - } + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an AsymmetricDecryptRequest. */ - class AsymmetricDecryptRequest implements IAsymmetricDecryptRequest { + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { - /** - * Constructs a new AsymmetricDecryptRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IAsymmetricDecryptRequest); + /** EnumDescriptorProto name */ + name?: (string|null); - /** AsymmetricDecryptRequest name. */ - public name: string; + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - /** AsymmetricDecryptRequest ciphertext. */ - public ciphertext: (Uint8Array|string); + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); - /** - * Creates a new AsymmetricDecryptRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricDecryptRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IAsymmetricDecryptRequest): google.cloud.kms.v1.AsymmetricDecryptRequest; + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - /** - * Encodes the specified AsymmetricDecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. - * @param message AsymmetricDecryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IAsymmetricDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** - * Encodes the specified AsymmetricDecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. - * @param message AsymmetricDecryptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { - /** - * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricDecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricDecryptRequest; + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); - /** - * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricDecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricDecryptRequest; + /** EnumDescriptorProto name. */ + public name: string; - /** - * Verifies an AsymmetricDecryptRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; - /** - * Creates an AsymmetricDecryptRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricDecryptRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricDecryptRequest; + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); - /** - * Creates a plain object from an AsymmetricDecryptRequest message. Also converts values to other types if specified. - * @param message AsymmetricDecryptRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.AsymmetricDecryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - /** - * Converts this AsymmetricDecryptRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; - /** Properties of a DecryptResponse. */ - interface IDecryptResponse { + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - /** DecryptResponse plaintext */ - plaintext?: (Uint8Array|string|null); - } + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a DecryptResponse. */ - class DecryptResponse implements IDecryptResponse { + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new DecryptResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IDecryptResponse); + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - /** DecryptResponse plaintext. */ - public plaintext: (Uint8Array|string); + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - /** - * Creates a new DecryptResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DecryptResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IDecryptResponse): google.cloud.kms.v1.DecryptResponse; + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified DecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. - * @param message DecryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - /** - * Encodes the specified DecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. - * @param message DecryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a DecryptResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DecryptResponse; + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a DecryptResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DecryptResponse; + namespace EnumDescriptorProto { - /** - * Verifies a DecryptResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { - /** - * Creates a DecryptResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecryptResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DecryptResponse; + /** EnumReservedRange start */ + start?: (number|null); - /** - * Creates a plain object from a DecryptResponse message. Also converts values to other types if specified. - * @param message DecryptResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.DecryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnumReservedRange end */ + end?: (number|null); + } - /** - * Converts this DecryptResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { - /** Properties of an EncryptResponse. */ - interface IEncryptResponse { + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - /** EncryptResponse name */ - name?: (string|null); + /** EnumReservedRange start. */ + public start: number; - /** EncryptResponse ciphertext */ - ciphertext?: (Uint8Array|string|null); - } + /** EnumReservedRange end. */ + public end: number; - /** Represents an EncryptResponse. */ - class EncryptResponse implements IEncryptResponse { + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - /** - * Constructs a new EncryptResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IEncryptResponse); + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** EncryptResponse name. */ - public name: string; + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - /** EncryptResponse ciphertext. */ - public ciphertext: (Uint8Array|string); + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - /** - * Creates a new EncryptResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IEncryptResponse): google.cloud.kms.v1.EncryptResponse; + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - /** - * Encodes the specified EncryptResponse message. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. - * @param message EncryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IEncryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified EncryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. - * @param message EncryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IEncryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - /** - * Decodes an EncryptResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.EncryptResponse; + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an EncryptResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.EncryptResponse; + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Verifies an EncryptResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { - /** - * Creates an EncryptResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.EncryptResponse; + /** EnumValueDescriptorProto name */ + name?: (string|null); - /** - * Creates a plain object from an EncryptResponse message. Also converts values to other types if specified. - * @param message EncryptResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.EncryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnumValueDescriptorProto number */ + number?: (number|null); - /** - * Converts this EncryptResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } - /** Properties of an AsymmetricSignResponse. */ - interface IAsymmetricSignResponse { + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - /** AsymmetricSignResponse signature */ - signature?: (Uint8Array|string|null); - } + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - /** Represents an AsymmetricSignResponse. */ - class AsymmetricSignResponse implements IAsymmetricSignResponse { + /** EnumValueDescriptorProto name. */ + public name: string; - /** - * Constructs a new AsymmetricSignResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IAsymmetricSignResponse); + /** EnumValueDescriptorProto number. */ + public number: number; - /** AsymmetricSignResponse signature. */ - public signature: (Uint8Array|string); + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); - /** - * Creates a new AsymmetricSignResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricSignResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IAsymmetricSignResponse): google.cloud.kms.v1.AsymmetricSignResponse; + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - /** - * Encodes the specified AsymmetricSignResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. - * @param message AsymmetricSignResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IAsymmetricSignResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified AsymmetricSignResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. - * @param message AsymmetricSignResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricSignResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AsymmetricSignResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricSignResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricSignResponse; + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - /** - * Decodes an AsymmetricSignResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricSignResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricSignResponse; + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - /** - * Verifies an AsymmetricSignResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an AsymmetricSignResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricSignResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricSignResponse; + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - /** - * Creates a plain object from an AsymmetricSignResponse message. Also converts values to other types if specified. - * @param message AsymmetricSignResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.AsymmetricSignResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this AsymmetricSignResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an AsymmetricDecryptResponse. */ - interface IAsymmetricDecryptResponse { + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { - /** AsymmetricDecryptResponse plaintext */ - plaintext?: (Uint8Array|string|null); - } + /** ServiceDescriptorProto name */ + name?: (string|null); - /** Represents an AsymmetricDecryptResponse. */ - class AsymmetricDecryptResponse implements IAsymmetricDecryptResponse { + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** - * Constructs a new AsymmetricDecryptResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IAsymmetricDecryptResponse); + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } - /** AsymmetricDecryptResponse plaintext. */ - public plaintext: (Uint8Array|string); + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { - /** - * Creates a new AsymmetricDecryptResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AsymmetricDecryptResponse instance - */ - public static create(properties?: google.cloud.kms.v1.IAsymmetricDecryptResponse): google.cloud.kms.v1.AsymmetricDecryptResponse; + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** - * Encodes the specified AsymmetricDecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. - * @param message AsymmetricDecryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IAsymmetricDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceDescriptorProto name. */ + public name: string; - /** - * Encodes the specified AsymmetricDecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. - * @param message AsymmetricDecryptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** - * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AsymmetricDecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricDecryptResponse; + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); - /** - * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AsymmetricDecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricDecryptResponse; + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - /** - * Verifies an AsymmetricDecryptResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an AsymmetricDecryptResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AsymmetricDecryptResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricDecryptResponse; + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an AsymmetricDecryptResponse message. Also converts values to other types if specified. - * @param message AsymmetricDecryptResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.AsymmetricDecryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - /** - * Converts this AsymmetricDecryptResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - /** Properties of an UpdateCryptoKeyPrimaryVersionRequest. */ - interface IUpdateCryptoKeyPrimaryVersionRequest { + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UpdateCryptoKeyPrimaryVersionRequest name */ - name?: (string|null); + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - /** UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId */ - cryptoKeyVersionId?: (string|null); - } + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an UpdateCryptoKeyPrimaryVersionRequest. */ - class UpdateCryptoKeyPrimaryVersionRequest implements IUpdateCryptoKeyPrimaryVersionRequest { + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new UpdateCryptoKeyPrimaryVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest); + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** UpdateCryptoKeyPrimaryVersionRequest name. */ - public name: string; + /** MethodDescriptorProto name */ + name?: (string|null); - /** UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId. */ - public cryptoKeyVersionId: string; + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** - * Creates a new UpdateCryptoKeyPrimaryVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCryptoKeyPrimaryVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** - * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. - * @param message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** - * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. - * @param message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); - /** - * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCryptoKeyPrimaryVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } - /** - * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCryptoKeyPrimaryVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { - /** - * Verifies an UpdateCryptoKeyPrimaryVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** - * Creates an UpdateCryptoKeyPrimaryVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCryptoKeyPrimaryVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + /** MethodDescriptorProto name. */ + public name: string; - /** - * Creates a plain object from an UpdateCryptoKeyPrimaryVersionRequest message. Also converts values to other types if specified. - * @param message UpdateCryptoKeyPrimaryVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MethodDescriptorProto inputType. */ + public inputType: string; - /** - * Converts this UpdateCryptoKeyPrimaryVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MethodDescriptorProto outputType. */ + public outputType: string; - /** Properties of a DestroyCryptoKeyVersionRequest. */ - interface IDestroyCryptoKeyVersionRequest { + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); - /** DestroyCryptoKeyVersionRequest name */ - name?: (string|null); - } + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; - /** Represents a DestroyCryptoKeyVersionRequest. */ - class DestroyCryptoKeyVersionRequest implements IDestroyCryptoKeyVersionRequest { + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; - /** - * Constructs a new DestroyCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest); + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - /** DestroyCryptoKeyVersionRequest name. */ - public name: string; + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new DestroyCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DestroyCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DestroyCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. - * @param message DestroyCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - /** - * Encodes the specified DestroyCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. - * @param message DestroyCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - /** - * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DestroyCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DestroyCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - /** - * Verifies a DestroyCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a DestroyCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DestroyCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a DestroyCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message DestroyCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.DestroyCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a FileOptions. */ + interface IFileOptions { - /** - * Converts this DestroyCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions javaPackage */ + javaPackage?: (string|null); - /** Properties of a RestoreCryptoKeyVersionRequest. */ - interface IRestoreCryptoKeyVersionRequest { + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); - /** RestoreCryptoKeyVersionRequest name */ - name?: (string|null); - } + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); - /** Represents a RestoreCryptoKeyVersionRequest. */ - class RestoreCryptoKeyVersionRequest implements IRestoreCryptoKeyVersionRequest { + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); - /** - * Constructs a new RestoreCryptoKeyVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest); + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); - /** RestoreCryptoKeyVersionRequest name. */ - public name: string; + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - /** - * Creates a new RestoreCryptoKeyVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreCryptoKeyVersionRequest instance - */ - public static create(properties?: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + /** FileOptions goPackage */ + goPackage?: (string|null); - /** - * Encodes the specified RestoreCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. - * @param message RestoreCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); - /** - * Encodes the specified RestoreCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. - * @param message RestoreCryptoKeyVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); - /** - * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); - /** - * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); - /** - * Verifies a RestoreCryptoKeyVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions deprecated */ + deprecated?: (boolean|null); - /** - * Creates a RestoreCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreCryptoKeyVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); - /** - * Creates a plain object from a RestoreCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @param message RestoreCryptoKeyVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.RestoreCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); - /** - * Converts this RestoreCryptoKeyVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** Properties of a Digest. */ - interface IDigest { + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** Digest sha256 */ - sha256?: (Uint8Array|string|null); + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - /** Digest sha384 */ - sha384?: (Uint8Array|string|null); + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** Digest sha512 */ - sha512?: (Uint8Array|string|null); - } + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** Represents a Digest. */ - class Digest implements IDigest { + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Constructs a new Digest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IDigest); + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } - /** Digest sha256. */ - public sha256: (Uint8Array|string); + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** Digest sha384. */ - public sha384: (Uint8Array|string); + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** Digest sha512. */ - public sha512: (Uint8Array|string); + /** FileOptions javaPackage. */ + public javaPackage: string; - /** Digest digest. */ - public digest?: ("sha256"|"sha384"|"sha512"); + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** - * Creates a new Digest instance using the specified properties. - * @param [properties] Properties to set - * @returns Digest instance - */ - public static create(properties?: google.cloud.kms.v1.IDigest): google.cloud.kms.v1.Digest; + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** - * Encodes the specified Digest message. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. - * @param message Digest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IDigest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; - /** - * Encodes the specified Digest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. - * @param message Digest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IDigest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; - /** - * Decodes a Digest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Digest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.Digest; + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - /** - * Decodes a Digest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Digest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.Digest; + /** FileOptions goPackage. */ + public goPackage: string; - /** - * Verifies a Digest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; - /** - * Creates a Digest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Digest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.Digest; + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; - /** - * Creates a plain object from a Digest message. Also converts values to other types if specified. - * @param message Digest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.Digest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; - /** - * Converts this Digest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; - /** Properties of a LocationMetadata. */ - interface ILocationMetadata { + /** FileOptions deprecated. */ + public deprecated: boolean; - /** LocationMetadata hsmAvailable */ - hsmAvailable?: (boolean|null); - } + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; - /** Represents a LocationMetadata. */ - class LocationMetadata implements ILocationMetadata { + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; - /** - * Constructs a new LocationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ILocationMetadata); + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; - /** LocationMetadata hsmAvailable. */ - public hsmAvailable: boolean; + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; - /** - * Creates a new LocationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationMetadata instance - */ - public static create(properties?: google.cloud.kms.v1.ILocationMetadata): google.cloud.kms.v1.LocationMetadata; + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; - /** - * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. - * @param message LocationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpNamespace. */ + public phpNamespace: string; - /** - * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. - * @param message LocationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; - /** - * Decodes a LocationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.LocationMetadata; + /** FileOptions rubyPackage. */ + public rubyPackage: string; - /** - * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.LocationMetadata; + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Verifies a LocationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - /** - * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.LocationMetadata; + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - /** - * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. - * @param message LocationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - /** - * Converts this LocationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a KeyRing. */ - interface IKeyRing { + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - /** KeyRing name */ - name?: (string|null); + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** KeyRing createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a KeyRing. */ - class KeyRing implements IKeyRing { + namespace FileOptions { - /** - * Constructs a new KeyRing. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IKeyRing); + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** KeyRing name. */ - public name: string; + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** KeyRing createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** - * Creates a new KeyRing instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyRing instance - */ - public static create(properties?: google.cloud.kms.v1.IKeyRing): google.cloud.kms.v1.KeyRing; + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** - * Encodes the specified KeyRing message. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. - * @param message KeyRing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IKeyRing, writer?: $protobuf.Writer): $protobuf.Writer; + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** - * Encodes the specified KeyRing message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. - * @param message KeyRing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IKeyRing, writer?: $protobuf.Writer): $protobuf.Writer; + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** - * Decodes a KeyRing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyRing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyRing; + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Decodes a KeyRing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyRing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyRing; + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } - /** - * Verifies a KeyRing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { - /** - * Creates a KeyRing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyRing - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyRing; + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); - /** - * Creates a plain object from a KeyRing message. Also converts values to other types if specified. - * @param message KeyRing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.KeyRing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** - * Converts this KeyRing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** Properties of a CryptoKey. */ - interface ICryptoKey { + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** CryptoKey name */ - name?: (string|null); + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** CryptoKey primary */ - primary?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** CryptoKey purpose */ - purpose?: (google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|keyof typeof google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|null); + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - /** CryptoKey createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKey nextRotationTime */ - nextRotationTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKey rotationPeriod */ - rotationPeriod?: (google.protobuf.IDuration|null); + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - /** CryptoKey versionTemplate */ - versionTemplate?: (google.cloud.kms.v1.ICryptoKeyVersionTemplate|null); + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - /** CryptoKey labels */ - labels?: ({ [k: string]: string }|null); - } + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a CryptoKey. */ - class CryptoKey implements ICryptoKey { + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - /** - * Constructs a new CryptoKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICryptoKey); + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CryptoKey name. */ - public name: string; + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** CryptoKey primary. */ - public primary?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** CryptoKey purpose. */ - public purpose: (google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|keyof typeof google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose); + /** FieldOptions packed */ + packed?: (boolean|null); - /** CryptoKey createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - /** CryptoKey nextRotationTime. */ - public nextRotationTime?: (google.protobuf.ITimestamp|null); + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** CryptoKey rotationPeriod. */ - public rotationPeriod?: (google.protobuf.IDuration|null); + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** CryptoKey versionTemplate. */ - public versionTemplate?: (google.cloud.kms.v1.ICryptoKeyVersionTemplate|null); + /** FieldOptions weak */ + weak?: (boolean|null); - /** CryptoKey labels. */ - public labels: { [k: string]: string }; + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** CryptoKey rotationSchedule. */ - public rotationSchedule?: "rotationPeriod"; + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - /** - * Creates a new CryptoKey instance using the specified properties. - * @param [properties] Properties to set - * @returns CryptoKey instance - */ - public static create(properties?: google.cloud.kms.v1.ICryptoKey): google.cloud.kms.v1.CryptoKey; + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } - /** - * Encodes the specified CryptoKey message. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. - * @param message CryptoKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { - /** - * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. - * @param message CryptoKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); - /** - * Decodes a CryptoKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CryptoKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKey; + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** - * Decodes a CryptoKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CryptoKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKey; + /** FieldOptions packed. */ + public packed: boolean; - /** - * Verifies a CryptoKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - /** - * Creates a CryptoKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CryptoKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKey; + /** FieldOptions lazy. */ + public lazy: boolean; - /** - * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. - * @param message CryptoKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** - * Converts this CryptoKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldOptions weak. */ + public weak: boolean; - namespace CryptoKey { + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** CryptoKeyPurpose enum. */ - enum CryptoKeyPurpose { - CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0, - ENCRYPT_DECRYPT = 1, - ASYMMETRIC_SIGN = 5, - ASYMMETRIC_DECRYPT = 6 - } - } + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - /** Properties of a CryptoKeyVersionTemplate. */ - interface ICryptoKeyVersionTemplate { + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKeyVersionTemplate protectionLevel */ - protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKeyVersionTemplate algorithm */ - algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); - } + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - /** Represents a CryptoKeyVersionTemplate. */ - class CryptoKeyVersionTemplate implements ICryptoKeyVersionTemplate { + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - /** - * Constructs a new CryptoKeyVersionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICryptoKeyVersionTemplate); + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CryptoKeyVersionTemplate protectionLevel. */ - public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - /** CryptoKeyVersionTemplate algorithm. */ - public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new CryptoKeyVersionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns CryptoKeyVersionTemplate instance - */ - public static create(properties?: google.cloud.kms.v1.ICryptoKeyVersionTemplate): google.cloud.kms.v1.CryptoKeyVersionTemplate; + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified CryptoKeyVersionTemplate message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. - * @param message CryptoKeyVersionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICryptoKeyVersionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + namespace FieldOptions { - /** - * Encodes the specified CryptoKeyVersionTemplate message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. - * @param message CryptoKeyVersionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKeyVersionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } - /** - * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CryptoKeyVersionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKeyVersionTemplate; + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } - /** - * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CryptoKeyVersionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKeyVersionTemplate; + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** - * Verifies a CryptoKeyVersionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates a CryptoKeyVersionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CryptoKeyVersionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKeyVersionTemplate; + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { - /** - * Creates a plain object from a CryptoKeyVersionTemplate message. Also converts values to other types if specified. - * @param message CryptoKeyVersionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CryptoKeyVersionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); - /** - * Converts this CryptoKeyVersionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** Properties of a KeyOperationAttestation. */ - interface IKeyOperationAttestation { + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - /** KeyOperationAttestation format */ - format?: (google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|keyof typeof google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|null); + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** KeyOperationAttestation content */ - content?: (Uint8Array|string|null); - } + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a KeyOperationAttestation. */ - class KeyOperationAttestation implements IKeyOperationAttestation { + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - /** - * Constructs a new KeyOperationAttestation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IKeyOperationAttestation); + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - /** KeyOperationAttestation format. */ - public format: (google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|keyof typeof google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat); + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** KeyOperationAttestation content. */ - public content: (Uint8Array|string); + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - /** - * Creates a new KeyOperationAttestation instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyOperationAttestation instance - */ - public static create(properties?: google.cloud.kms.v1.IKeyOperationAttestation): google.cloud.kms.v1.KeyOperationAttestation; + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified KeyOperationAttestation message. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. - * @param message KeyOperationAttestation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IKeyOperationAttestation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified KeyOperationAttestation message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. - * @param message KeyOperationAttestation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IKeyOperationAttestation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** - * Decodes a KeyOperationAttestation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyOperationAttestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyOperationAttestation; + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** - * Decodes a KeyOperationAttestation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyOperationAttestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyOperationAttestation; + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** - * Verifies a KeyOperationAttestation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates a KeyOperationAttestation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyOperationAttestation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyOperationAttestation; + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { - /** - * Creates a plain object from a KeyOperationAttestation message. Also converts values to other types if specified. - * @param message KeyOperationAttestation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.KeyOperationAttestation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); - /** - * Converts this KeyOperationAttestation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - namespace KeyOperationAttestation { + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** AttestationFormat enum. */ - enum AttestationFormat { - ATTESTATION_FORMAT_UNSPECIFIED = 0, - CAVIUM_V1_COMPRESSED = 3, - CAVIUM_V2_COMPRESSED = 4 - } - } + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** Properties of a CryptoKeyVersion. */ - interface ICryptoKeyVersion { + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - /** CryptoKeyVersion name */ - name?: (string|null); + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKeyVersion state */ - state?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|null); + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - /** CryptoKeyVersion protectionLevel */ - protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CryptoKeyVersion algorithm */ - algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - /** CryptoKeyVersion attestation */ - attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CryptoKeyVersion createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CryptoKeyVersion generateTime */ - generateTime?: (google.protobuf.ITimestamp|null); + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** CryptoKeyVersion destroyTime */ - destroyTime?: (google.protobuf.ITimestamp|null); + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** CryptoKeyVersion destroyEventTime */ - destroyEventTime?: (google.protobuf.ITimestamp|null); + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** CryptoKeyVersion importJob */ - importJob?: (string|null); + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { - /** CryptoKeyVersion importTime */ - importTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); - /** CryptoKeyVersion importFailureReason */ - importFailureReason?: (string|null); - } + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** Represents a CryptoKeyVersion. */ - class CryptoKeyVersion implements ICryptoKeyVersion { + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Constructs a new CryptoKeyVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ICryptoKeyVersion); + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - /** CryptoKeyVersion name. */ - public name: string; + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKeyVersion state. */ - public state: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState); + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** CryptoKeyVersion protectionLevel. */ - public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - /** CryptoKeyVersion algorithm. */ - public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - /** CryptoKeyVersion attestation. */ - public attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CryptoKeyVersion createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - /** CryptoKeyVersion generateTime. */ - public generateTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CryptoKeyVersion destroyTime. */ - public destroyTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CryptoKeyVersion destroyEventTime. */ - public destroyEventTime?: (google.protobuf.ITimestamp|null); + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** CryptoKeyVersion importJob. */ - public importJob: string; + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** CryptoKeyVersion importTime. */ - public importTime?: (google.protobuf.ITimestamp|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** CryptoKeyVersion importFailureReason. */ - public importFailureReason: string; + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** - * Creates a new CryptoKeyVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns CryptoKeyVersion instance - */ - public static create(properties?: google.cloud.kms.v1.ICryptoKeyVersion): google.cloud.kms.v1.CryptoKeyVersion; + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } - /** - * Encodes the specified CryptoKeyVersion message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. - * @param message CryptoKeyVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ICryptoKeyVersion, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { - /** - * Encodes the specified CryptoKeyVersion message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. - * @param message CryptoKeyVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKeyVersion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); - /** - * Decodes a CryptoKeyVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CryptoKeyVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKeyVersion; + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** - * Decodes a CryptoKeyVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CryptoKeyVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKeyVersion; + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Verifies a CryptoKeyVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - /** - * Creates a CryptoKeyVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CryptoKeyVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKeyVersion; + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a CryptoKeyVersion message. Also converts values to other types if specified. - * @param message CryptoKeyVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.CryptoKeyVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this CryptoKeyVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - namespace CryptoKeyVersion { + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - /** CryptoKeyVersionAlgorithm enum. */ - enum CryptoKeyVersionAlgorithm { - CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0, - GOOGLE_SYMMETRIC_ENCRYPTION = 1, - RSA_SIGN_PSS_2048_SHA256 = 2, - RSA_SIGN_PSS_3072_SHA256 = 3, - RSA_SIGN_PSS_4096_SHA256 = 4, - RSA_SIGN_PSS_4096_SHA512 = 15, - RSA_SIGN_PKCS1_2048_SHA256 = 5, - RSA_SIGN_PKCS1_3072_SHA256 = 6, - RSA_SIGN_PKCS1_4096_SHA256 = 7, - RSA_SIGN_PKCS1_4096_SHA512 = 16, - RSA_DECRYPT_OAEP_2048_SHA256 = 8, - RSA_DECRYPT_OAEP_3072_SHA256 = 9, - RSA_DECRYPT_OAEP_4096_SHA256 = 10, - RSA_DECRYPT_OAEP_4096_SHA512 = 17, - EC_SIGN_P256_SHA256 = 12, - EC_SIGN_P384_SHA384 = 13 - } + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CryptoKeyVersionState enum. */ - enum CryptoKeyVersionState { - CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0, - PENDING_GENERATION = 5, - ENABLED = 1, - DISABLED = 2, - DESTROYED = 3, - DESTROY_SCHEDULED = 4, - PENDING_IMPORT = 6, - IMPORT_FAILED = 7 - } + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - /** CryptoKeyVersionView enum. */ - enum CryptoKeyVersionView { - CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0, - FULL = 1 - } - } + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a PublicKey. */ - interface IPublicKey { + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** PublicKey pem */ - pem?: (string|null); + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** PublicKey algorithm */ - algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); - } + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** - * Constructs a new PublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IPublicKey); + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** PublicKey pem. */ - public pem: string; + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** PublicKey algorithm. */ - public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: google.cloud.kms.v1.IPublicKey): google.cloud.kms.v1.PublicKey; + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.PublicKey; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.PublicKey; + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Verifies a PublicKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublicKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.PublicKey; + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @param message PublicKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this PublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - /** Properties of an ImportJob. */ - interface IImportJob { + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - /** ImportJob name */ - name?: (string|null); + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ImportJob importMethod */ - importMethod?: (google.cloud.kms.v1.ImportJob.ImportMethod|keyof typeof google.cloud.kms.v1.ImportJob.ImportMethod|null); + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - /** ImportJob protectionLevel */ - protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ImportJob createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ImportJob generateTime */ - generateTime?: (google.protobuf.ITimestamp|null); + namespace MethodOptions { - /** ImportJob expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** ImportJob expireEventTime */ - expireEventTime?: (google.protobuf.ITimestamp|null); + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** ImportJob state */ - state?: (google.cloud.kms.v1.ImportJob.ImportJobState|keyof typeof google.cloud.kms.v1.ImportJob.ImportJobState|null); + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** ImportJob publicKey */ - publicKey?: (google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null); + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** ImportJob attestation */ - attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); - } + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** Represents an ImportJob. */ - class ImportJob implements IImportJob { + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** - * Constructs a new ImportJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.IImportJob); + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** ImportJob name. */ - public name: string; + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** ImportJob importMethod. */ - public importMethod: (google.cloud.kms.v1.ImportJob.ImportMethod|keyof typeof google.cloud.kms.v1.ImportJob.ImportMethod); + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** ImportJob protectionLevel. */ - public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** ImportJob createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ImportJob generateTime. */ - public generateTime?: (google.protobuf.ITimestamp|null); + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** ImportJob expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** ImportJob expireEventTime. */ - public expireEventTime?: (google.protobuf.ITimestamp|null); + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); - /** ImportJob state. */ - public state: (google.cloud.kms.v1.ImportJob.ImportJobState|keyof typeof google.cloud.kms.v1.ImportJob.ImportJobState); + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); - /** ImportJob publicKey. */ - public publicKey?: (google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null); + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** ImportJob attestation. */ - public attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); - /** - * Creates a new ImportJob instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportJob instance - */ - public static create(properties?: google.cloud.kms.v1.IImportJob): google.cloud.kms.v1.ImportJob; + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; - /** - * Encodes the specified ImportJob message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. - * @param message ImportJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.IImportJob, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - /** - * Encodes the specified ImportJob message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. - * @param message ImportJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.IImportJob, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ImportJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportJob; + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ImportJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportJob; + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - /** - * Verifies an ImportJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - /** - * Creates an ImportJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportJob; + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from an ImportJob message. Also converts values to other types if specified. - * @param message ImportJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ImportJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - /** - * Converts this ImportJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace ImportJob { + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a WrappingPublicKey. */ - interface IWrappingPublicKey { + namespace UninterpretedOption { - /** WrappingPublicKey pem */ - pem?: (string|null); - } + /** Properties of a NamePart. */ + interface INamePart { - /** Represents a WrappingPublicKey. */ - class WrappingPublicKey implements IWrappingPublicKey { + /** NamePart namePart */ + namePart: string; - /** - * Constructs a new WrappingPublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.kms.v1.ImportJob.IWrappingPublicKey); + /** NamePart isExtension */ + isExtension: boolean; + } - /** WrappingPublicKey pem. */ - public pem: string; + /** Represents a NamePart. */ + class NamePart implements INamePart { - /** - * Creates a new WrappingPublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns WrappingPublicKey instance - */ - public static create(properties?: google.cloud.kms.v1.ImportJob.IWrappingPublicKey): google.cloud.kms.v1.ImportJob.WrappingPublicKey; + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** - * Encodes the specified WrappingPublicKey message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. - * @param message WrappingPublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.kms.v1.ImportJob.IWrappingPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** NamePart namePart. */ + public namePart: string; - /** - * Encodes the specified WrappingPublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. - * @param message WrappingPublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.kms.v1.ImportJob.IWrappingPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + /** NamePart isExtension. */ + public isExtension: boolean; - /** - * Decodes a WrappingPublicKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WrappingPublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportJob.WrappingPublicKey; + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - /** - * Decodes a WrappingPublicKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WrappingPublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportJob.WrappingPublicKey; + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a WrappingPublicKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a WrappingPublicKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WrappingPublicKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportJob.WrappingPublicKey; + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - /** - * Creates a plain object from a WrappingPublicKey message. Also converts values to other types if specified. - * @param message WrappingPublicKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.kms.v1.ImportJob.WrappingPublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - /** - * Converts this WrappingPublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ImportMethod enum. */ - enum ImportMethod { - IMPORT_METHOD_UNSPECIFIED = 0, - RSA_OAEP_3072_SHA1_AES_256 = 1, - RSA_OAEP_4096_SHA1_AES_256 = 2 - } + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - /** ImportJobState enum. */ - enum ImportJobState { - IMPORT_JOB_STATE_UNSPECIFIED = 0, - PENDING_GENERATION = 1, - ACTIVE = 2, - EXPIRED = 3 - } - } + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ProtectionLevel enum. */ - enum ProtectionLevel { - PROTECTION_LEVEL_UNSPECIFIED = 0, - SOFTWARE = 1, - HSM = 2, - EXTERNAL = 3 - } + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { /** - * Constructs a new Http. + * Constructs a new SourceCodeInfo. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new Http instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @returns SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @returns SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a Http message. + * Verifies a SourceCodeInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { + namespace SourceCodeInfo { - /** HttpRule selector */ - selector?: (string|null); + /** Properties of a Location. */ + interface ILocation { - /** HttpRule get */ - get?: (string|null); + /** Location path */ + path?: (number[]|null); - /** HttpRule put */ - put?: (string|null); + /** Location span */ + span?: (number[]|null); - /** HttpRule post */ - post?: (string|null); + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** HttpRule delete */ - "delete"?: (string|null); + /** Location path. */ + public path: number[]; - /** HttpRule patch */ - patch?: (string|null); + /** Location span. */ + public span: number[]; - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** Location leadingComments. */ + public leadingComments: string; - /** HttpRule body */ - body?: (string|null); + /** Location trailingComments. */ + public trailingComments: string; - /** HttpRule responseBody */ - responseBody?: (string|null); + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule selector. */ - public selector: string; + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - /** HttpRule get. */ - public get: string; + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - /** HttpRule put. */ - public put: string; + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** HttpRule post. */ - public post: string; + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - /** HttpRule delete. */ - public delete: string; + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** HttpRule patch. */ - public patch: string; + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { - /** HttpRule body. */ - public body: string; + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } - /** HttpRule responseBody. */ - public responseBody: string; + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns GeneratedCodeInfo instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies a HttpRule message. + * Verifies a GeneratedCodeInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } + namespace GeneratedCodeInfo { - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Properties of an Annotation. */ + interface IAnnotation { - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); + /** Annotation path */ + path?: (number[]|null); - /** CustomHttpPattern kind. */ - public kind: string; + /** Annotation sourceFile */ + sourceFile?: (string|null); - /** CustomHttpPattern path. */ - public path: string; + /** Annotation begin */ + begin?: (number|null); - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + /** Annotation end */ + end?: (number|null); + } - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an Annotation. */ + class Annotation implements IAnnotation { - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + /** Annotation path. */ + public path: number[]; - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + /** Annotation sourceFile. */ + public sourceFile: string; - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Annotation begin. */ + public begin: number; - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + /** Annotation end. */ + public end: number; - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5 - } + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - /** ResourceDescriptor type */ - type?: (string|null); + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ResourceDescriptor plural */ - plural?: (string|null); + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new ResourceDescriptor. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + constructor(properties?: google.protobuf.IDuration); - /** ResourceDescriptor plural. */ - public plural: string; + /** Duration seconds. */ + public seconds: (number|Long|string); - /** ResourceDescriptor singular. */ - public singular: string; + /** Duration nanos. */ + public nanos: number; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns Duration instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceDescriptor + * @returns Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @returns Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies a ResourceDescriptor message. + * Verifies a Duration message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** ResourceReference type */ - type?: (string|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** ResourceReference childType */ - childType?: (string|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new ResourceReference. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.protobuf.ITimestamp); - /** ResourceReference type. */ - public type: string; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** ResourceReference childType. */ - public childType: string; + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns Timestamp instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceReference + * @returns Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @returns Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies a ResourceReference message. + * Verifies a Timestamp message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Namespace protobuf. */ - namespace protobuf { - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** Properties of a FieldMask. */ + interface IFieldMask { - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new FileDescriptorSet. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + constructor(properties?: google.protobuf.IFieldMask); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorSet instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FileDescriptorSet + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies a FileDescriptorSet message. + * Verifies a FieldMask message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorSet + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorSet to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** Namespace cloud. */ + namespace cloud { - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); + /** Namespace kms. */ + namespace kms { - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** Namespace v1. */ + namespace v1 { - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** Properties of a KeyRing. */ + interface IKeyRing { - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** KeyRing name */ + name?: (string|null); - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } + /** KeyRing createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** Represents a KeyRing. */ + class KeyRing implements IKeyRing { - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); + /** + * Constructs a new KeyRing. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IKeyRing); - /** FileDescriptorProto name. */ - public name: string; + /** KeyRing name. */ + public name: string; - /** FileDescriptorProto package. */ - public package: string; + /** KeyRing createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** FileDescriptorProto dependency. */ - public dependency: string[]; + /** + * Creates a new KeyRing instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRing instance + */ + public static create(properties?: google.cloud.kms.v1.IKeyRing): google.cloud.kms.v1.KeyRing; - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; + /** + * Encodes the specified KeyRing message. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. + * @param message KeyRing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IKeyRing, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; + /** + * Encodes the specified KeyRing message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. + * @param message KeyRing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IKeyRing, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; + /** + * Decodes a KeyRing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyRing; - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Decodes a KeyRing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyRing; - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; + /** + * Verifies a KeyRing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** + * Creates a KeyRing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRing + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyRing; - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** + * Creates a plain object from a KeyRing message. Also converts values to other types if specified. + * @param message KeyRing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.KeyRing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** + * Converts this KeyRing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto syntax. */ - public syntax: string; + /** Properties of a CryptoKey. */ + interface ICryptoKey { - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + /** CryptoKey name */ + name?: (string|null); - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKey primary */ + primary?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKey purpose */ + purpose?: (google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|keyof typeof google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|null); - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + /** CryptoKey createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + /** CryptoKey nextRotationTime */ + nextRotationTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CryptoKey rotationPeriod */ + rotationPeriod?: (google.protobuf.IDuration|null); - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + /** CryptoKey versionTemplate */ + versionTemplate?: (google.cloud.kms.v1.ICryptoKeyVersionTemplate|null); - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CryptoKey labels */ + labels?: ({ [k: string]: string }|null); + } - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a CryptoKey. */ + class CryptoKey implements ICryptoKey { - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { + /** + * Constructs a new CryptoKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICryptoKey); - /** DescriptorProto name */ - name?: (string|null); + /** CryptoKey name. */ + public name: string; - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); + /** CryptoKey primary. */ + public primary?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** CryptoKey purpose. */ + public purpose: (google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|keyof typeof google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose); - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); + /** CryptoKey createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** CryptoKey nextRotationTime. */ + public nextRotationTime?: (google.protobuf.ITimestamp|null); - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + /** CryptoKey rotationPeriod. */ + public rotationPeriod?: (google.protobuf.IDuration|null); - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** CryptoKey versionTemplate. */ + public versionTemplate?: (google.cloud.kms.v1.ICryptoKeyVersionTemplate|null); - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** CryptoKey labels. */ + public labels: { [k: string]: string }; - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** CryptoKey rotationSchedule. */ + public rotationSchedule?: "rotationPeriod"; - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Creates a new CryptoKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKey instance + */ + public static create(properties?: google.cloud.kms.v1.ICryptoKey): google.cloud.kms.v1.CryptoKey; - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** + * Encodes the specified CryptoKey message. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. + * @param message CryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); + /** + * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. + * @param message CryptoKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** DescriptorProto name. */ - public name: string; + /** + * Decodes a CryptoKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKey; - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** + * Decodes a CryptoKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKey; - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** + * Verifies a CryptoKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** + * Creates a CryptoKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKey; - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. + * @param message CryptoKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CryptoKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** + * Converts this CryptoKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + namespace CryptoKey { - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** CryptoKeyPurpose enum. */ + enum CryptoKeyPurpose { + CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0, + ENCRYPT_DECRYPT = 1, + ASYMMETRIC_SIGN = 5, + ASYMMETRIC_DECRYPT = 6 + } + } - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** Properties of a CryptoKeyVersionTemplate. */ + interface ICryptoKeyVersionTemplate { - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** CryptoKeyVersionTemplate protectionLevel */ + protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + /** CryptoKeyVersionTemplate algorithm */ + algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); + } - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a CryptoKeyVersionTemplate. */ + class CryptoKeyVersionTemplate implements ICryptoKeyVersionTemplate { - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new CryptoKeyVersionTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICryptoKeyVersionTemplate); + + /** CryptoKeyVersionTemplate protectionLevel. */ + public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); + + /** CryptoKeyVersionTemplate algorithm. */ + public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + /** + * Creates a new CryptoKeyVersionTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKeyVersionTemplate instance + */ + public static create(properties?: google.cloud.kms.v1.ICryptoKeyVersionTemplate): google.cloud.kms.v1.CryptoKeyVersionTemplate; - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + /** + * Encodes the specified CryptoKeyVersionTemplate message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. + * @param message CryptoKeyVersionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICryptoKeyVersionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified CryptoKeyVersionTemplate message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. + * @param message CryptoKeyVersionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKeyVersionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + /** + * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKeyVersionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKeyVersionTemplate; - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKeyVersionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKeyVersionTemplate; - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a CryptoKeyVersionTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace DescriptorProto { + /** + * Creates a CryptoKeyVersionTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKeyVersionTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKeyVersionTemplate; - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** + * Creates a plain object from a CryptoKeyVersionTemplate message. Also converts values to other types if specified. + * @param message CryptoKeyVersionTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CryptoKeyVersionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ExtensionRange start */ - start?: (number|null); + /** + * Converts this CryptoKeyVersionTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExtensionRange end */ - end?: (number|null); + /** Properties of a KeyOperationAttestation. */ + interface IKeyOperationAttestation { - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } + /** KeyOperationAttestation format */ + format?: (google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|keyof typeof google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|null); - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** KeyOperationAttestation content */ + content?: (Uint8Array|string|null); + } - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + /** Represents a KeyOperationAttestation. */ + class KeyOperationAttestation implements IKeyOperationAttestation { - /** ExtensionRange start. */ - public start: number; + /** + * Constructs a new KeyOperationAttestation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IKeyOperationAttestation); - /** ExtensionRange end. */ - public end: number; + /** KeyOperationAttestation format. */ + public format: (google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|keyof typeof google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat); - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** KeyOperationAttestation content. */ + public content: (Uint8Array|string); - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + /** + * Creates a new KeyOperationAttestation instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyOperationAttestation instance + */ + public static create(properties?: google.cloud.kms.v1.IKeyOperationAttestation): google.cloud.kms.v1.KeyOperationAttestation; - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified KeyOperationAttestation message. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. + * @param message KeyOperationAttestation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IKeyOperationAttestation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified KeyOperationAttestation message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. + * @param message KeyOperationAttestation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IKeyOperationAttestation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + /** + * Decodes a KeyOperationAttestation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyOperationAttestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyOperationAttestation; - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + /** + * Decodes a KeyOperationAttestation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyOperationAttestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyOperationAttestation; - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a KeyOperationAttestation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + /** + * Creates a KeyOperationAttestation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyOperationAttestation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyOperationAttestation; - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a KeyOperationAttestation message. Also converts values to other types if specified. + * @param message KeyOperationAttestation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.KeyOperationAttestation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this KeyOperationAttestation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a ReservedRange. */ - interface IReservedRange { + namespace KeyOperationAttestation { - /** ReservedRange start */ - start?: (number|null); + /** AttestationFormat enum. */ + enum AttestationFormat { + ATTESTATION_FORMAT_UNSPECIFIED = 0, + CAVIUM_V1_COMPRESSED = 3, + CAVIUM_V2_COMPRESSED = 4 + } + } - /** ReservedRange end */ - end?: (number|null); - } + /** Properties of a CryptoKeyVersion. */ + interface ICryptoKeyVersion { - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** CryptoKeyVersion name */ + name?: (string|null); - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + /** CryptoKeyVersion state */ + state?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|null); - /** ReservedRange start. */ - public start: number; + /** CryptoKeyVersion protectionLevel */ + protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); - /** ReservedRange end. */ - public end: number; + /** CryptoKeyVersion algorithm */ + algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + /** CryptoKeyVersion attestation */ + attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKeyVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKeyVersion generateTime */ + generateTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + /** CryptoKeyVersion destroyTime */ + destroyTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + /** CryptoKeyVersion destroyEventTime */ + destroyEventTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CryptoKeyVersion importJob */ + importJob?: (string|null); - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + /** CryptoKeyVersion importTime */ + importTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CryptoKeyVersion importFailureReason */ + importFailureReason?: (string|null); + } - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Represents a CryptoKeyVersion. */ + class CryptoKeyVersion implements ICryptoKeyVersion { - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** + * Constructs a new CryptoKeyVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICryptoKeyVersion); - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** CryptoKeyVersion name. */ + public name: string; - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** CryptoKeyVersion state. */ + public state: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState); - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + /** CryptoKeyVersion protectionLevel. */ + public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** CryptoKeyVersion algorithm. */ + public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + /** CryptoKeyVersion attestation. */ + public attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKeyVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** CryptoKeyVersion generateTime. */ + public generateTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + /** CryptoKeyVersion destroyTime. */ + public destroyTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + /** CryptoKeyVersion destroyEventTime. */ + public destroyEventTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CryptoKeyVersion importJob. */ + public importJob: string; - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + /** CryptoKeyVersion importTime. */ + public importTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CryptoKeyVersion importFailureReason. */ + public importFailureReason: string; - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new CryptoKeyVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKeyVersion instance + */ + public static create(properties?: google.cloud.kms.v1.ICryptoKeyVersion): google.cloud.kms.v1.CryptoKeyVersion; - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { + /** + * Encodes the specified CryptoKeyVersion message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. + * @param message CryptoKeyVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICryptoKeyVersion, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto name */ - name?: (string|null); + /** + * Encodes the specified CryptoKeyVersion message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. + * @param message CryptoKeyVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICryptoKeyVersion, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto number */ - number?: (number|null); + /** + * Decodes a CryptoKeyVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKeyVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CryptoKeyVersion; - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + /** + * Decodes a CryptoKeyVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKeyVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CryptoKeyVersion; - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + /** + * Verifies a CryptoKeyVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldDescriptorProto typeName */ - typeName?: (string|null); + /** + * Creates a CryptoKeyVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKeyVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CryptoKeyVersion; - /** FieldDescriptorProto extendee */ - extendee?: (string|null); + /** + * Creates a plain object from a CryptoKeyVersion message. Also converts values to other types if specified. + * @param message CryptoKeyVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CryptoKeyVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); + /** + * Converts this CryptoKeyVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + namespace CryptoKeyVersion { - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** CryptoKeyVersionAlgorithm enum. */ + enum CryptoKeyVersionAlgorithm { + CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0, + GOOGLE_SYMMETRIC_ENCRYPTION = 1, + RSA_SIGN_PSS_2048_SHA256 = 2, + RSA_SIGN_PSS_3072_SHA256 = 3, + RSA_SIGN_PSS_4096_SHA256 = 4, + RSA_SIGN_PSS_4096_SHA512 = 15, + RSA_SIGN_PKCS1_2048_SHA256 = 5, + RSA_SIGN_PKCS1_3072_SHA256 = 6, + RSA_SIGN_PKCS1_4096_SHA256 = 7, + RSA_SIGN_PKCS1_4096_SHA512 = 16, + RSA_DECRYPT_OAEP_2048_SHA256 = 8, + RSA_DECRYPT_OAEP_3072_SHA256 = 9, + RSA_DECRYPT_OAEP_4096_SHA256 = 10, + RSA_DECRYPT_OAEP_4096_SHA512 = 17, + EC_SIGN_P256_SHA256 = 12, + EC_SIGN_P384_SHA384 = 13 + } - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } + /** CryptoKeyVersionState enum. */ + enum CryptoKeyVersionState { + CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0, + PENDING_GENERATION = 5, + ENABLED = 1, + DISABLED = 2, + DESTROYED = 3, + DESTROY_SCHEDULED = 4, + PENDING_IMPORT = 6, + IMPORT_FAILED = 7 + } - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** CryptoKeyVersionView enum. */ + enum CryptoKeyVersionView { + CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0, + FULL = 1 + } + } - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); + /** Properties of a PublicKey. */ + interface IPublicKey { - /** FieldDescriptorProto name. */ - public name: string; + /** PublicKey pem */ + pem?: (string|null); - /** FieldDescriptorProto number. */ - public number: number; + /** PublicKey algorithm */ + algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); + } - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + /** Represents a PublicKey. */ + class PublicKey implements IPublicKey { - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + /** + * Constructs a new PublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IPublicKey); - /** FieldDescriptorProto typeName. */ - public typeName: string; + /** PublicKey pem. */ + public pem: string; - /** FieldDescriptorProto extendee. */ - public extendee: string; + /** PublicKey algorithm. */ + public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; + /** + * Creates a new PublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicKey instance + */ + public static create(properties?: google.cloud.kms.v1.IPublicKey): google.cloud.kms.v1.PublicKey; - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. + * @param message PublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. + * @param message PublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.PublicKey; - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.PublicKey; - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a PublicKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.PublicKey; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @param message PublicKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + /** + * Converts this PublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an ImportJob. */ + interface IImportJob { - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + /** ImportJob name */ + name?: (string|null); - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportJob importMethod */ + importMethod?: (google.cloud.kms.v1.ImportJob.ImportMethod|keyof typeof google.cloud.kms.v1.ImportJob.ImportMethod|null); - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImportJob protectionLevel */ + protectionLevel?: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel|null); - namespace FieldDescriptorProto { + /** ImportJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } + /** ImportJob generateTime */ + generateTime?: (google.protobuf.ITimestamp|null); - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** ImportJob expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** ImportJob expireEventTime */ + expireEventTime?: (google.protobuf.ITimestamp|null); - /** OneofDescriptorProto name */ - name?: (string|null); + /** ImportJob state */ + state?: (google.cloud.kms.v1.ImportJob.ImportJobState|keyof typeof google.cloud.kms.v1.ImportJob.ImportJobState|null); - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } + /** ImportJob publicKey */ + publicKey?: (google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null); - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** ImportJob attestation */ + attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); + } - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + /** Represents an ImportJob. */ + class ImportJob implements IImportJob { - /** OneofDescriptorProto name. */ - public name: string; + /** + * Constructs a new ImportJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IImportJob); - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** ImportJob name. */ + public name: string; - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + /** ImportJob importMethod. */ + public importMethod: (google.cloud.kms.v1.ImportJob.ImportMethod|keyof typeof google.cloud.kms.v1.ImportJob.ImportMethod); - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportJob protectionLevel. */ + public protectionLevel: (google.cloud.kms.v1.ProtectionLevel|keyof typeof google.cloud.kms.v1.ProtectionLevel); - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + /** ImportJob generateTime. */ + public generateTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + /** ImportJob expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ImportJob expireEventTime. */ + public expireEventTime?: (google.protobuf.ITimestamp|null); - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + /** ImportJob state. */ + public state: (google.cloud.kms.v1.ImportJob.ImportJobState|keyof typeof google.cloud.kms.v1.ImportJob.ImportJobState); - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportJob publicKey. */ + public publicKey?: (google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null); - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImportJob attestation. */ + public attestation?: (google.cloud.kms.v1.IKeyOperationAttestation|null); - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + /** + * Creates a new ImportJob instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportJob instance + */ + public static create(properties?: google.cloud.kms.v1.IImportJob): google.cloud.kms.v1.ImportJob; - /** EnumDescriptorProto name */ - name?: (string|null); + /** + * Encodes the specified ImportJob message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. + * @param message ImportJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IImportJob, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** + * Encodes the specified ImportJob message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. + * @param message ImportJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IImportJob, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** + * Decodes an ImportJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportJob; - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** + * Decodes an ImportJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportJob; - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Verifies an ImportJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** + * Creates an ImportJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportJob; - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); + /** + * Creates a plain object from an ImportJob message. Also converts values to other types if specified. + * @param message ImportJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ImportJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumDescriptorProto name. */ - public name: string; + /** + * Converts this ImportJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; + namespace ImportJob { - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); + /** Properties of a WrappingPublicKey. */ + interface IWrappingPublicKey { - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** WrappingPublicKey pem */ + pem?: (string|null); + } - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** Represents a WrappingPublicKey. */ + class WrappingPublicKey implements IWrappingPublicKey { - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + /** + * Constructs a new WrappingPublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ImportJob.IWrappingPublicKey); - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** WrappingPublicKey pem. */ + public pem: string; - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new WrappingPublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns WrappingPublicKey instance + */ + public static create(properties?: google.cloud.kms.v1.ImportJob.IWrappingPublicKey): google.cloud.kms.v1.ImportJob.WrappingPublicKey; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + /** + * Encodes the specified WrappingPublicKey message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. + * @param message WrappingPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ImportJob.IWrappingPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + /** + * Encodes the specified WrappingPublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. + * @param message WrappingPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ImportJob.IWrappingPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a WrappingPublicKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WrappingPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportJob.WrappingPublicKey; - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + /** + * Decodes a WrappingPublicKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WrappingPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportJob.WrappingPublicKey; - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a WrappingPublicKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a WrappingPublicKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WrappingPublicKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportJob.WrappingPublicKey; - namespace EnumDescriptorProto { + /** + * Creates a plain object from a WrappingPublicKey message. Also converts values to other types if specified. + * @param message WrappingPublicKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ImportJob.WrappingPublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { + /** + * Converts this WrappingPublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumReservedRange start */ - start?: (number|null); + /** ImportMethod enum. */ + enum ImportMethod { + IMPORT_METHOD_UNSPECIFIED = 0, + RSA_OAEP_3072_SHA1_AES_256 = 1, + RSA_OAEP_4096_SHA1_AES_256 = 2 + } - /** EnumReservedRange end */ - end?: (number|null); - } + /** ImportJobState enum. */ + enum ImportJobState { + IMPORT_JOB_STATE_UNSPECIFIED = 0, + PENDING_GENERATION = 1, + ACTIVE = 2, + EXPIRED = 3 + } + } - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { + /** ProtectionLevel enum. */ + enum ProtectionLevel { + PROTECTION_LEVEL_UNSPECIFIED = 0, + SOFTWARE = 1, + HSM = 2, + EXTERNAL = 3 + } - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + /** Represents a KeyManagementService */ + class KeyManagementService extends $protobuf.rpc.Service { - /** EnumReservedRange start. */ - public start: number; + /** + * Constructs a new KeyManagementService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** EnumReservedRange end. */ - public end: number; + /** + * Creates new KeyManagementService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): KeyManagementService; - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + /** + * Calls ListKeyRings. + * @param request ListKeyRingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListKeyRingsResponse + */ + public listKeyRings(request: google.cloud.kms.v1.IListKeyRingsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListKeyRingsCallback): void; - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls ListKeyRings. + * @param request ListKeyRingsRequest message or plain object + * @returns Promise + */ + public listKeyRings(request: google.cloud.kms.v1.IListKeyRingsRequest): Promise; - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls ListCryptoKeys. + * @param request ListCryptoKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCryptoKeysResponse + */ + public listCryptoKeys(request: google.cloud.kms.v1.IListCryptoKeysRequest, callback: google.cloud.kms.v1.KeyManagementService.ListCryptoKeysCallback): void; - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + /** + * Calls ListCryptoKeys. + * @param request ListCryptoKeysRequest message or plain object + * @returns Promise + */ + public listCryptoKeys(request: google.cloud.kms.v1.IListCryptoKeysRequest): Promise; - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + /** + * Calls ListCryptoKeyVersions. + * @param request ListCryptoKeyVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCryptoKeyVersionsResponse + */ + public listCryptoKeyVersions(request: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersionsCallback): void; - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls ListCryptoKeyVersions. + * @param request ListCryptoKeyVersionsRequest message or plain object + * @returns Promise + */ + public listCryptoKeyVersions(request: google.cloud.kms.v1.IListCryptoKeyVersionsRequest): Promise; - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + /** + * Calls ListImportJobs. + * @param request ListImportJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListImportJobsResponse + */ + public listImportJobs(request: google.cloud.kms.v1.IListImportJobsRequest, callback: google.cloud.kms.v1.KeyManagementService.ListImportJobsCallback): void; - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls ListImportJobs. + * @param request ListImportJobsRequest message or plain object + * @returns Promise + */ + public listImportJobs(request: google.cloud.kms.v1.IListImportJobsRequest): Promise; - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Calls GetKeyRing. + * @param request GetKeyRingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KeyRing + */ + public getKeyRing(request: google.cloud.kms.v1.IGetKeyRingRequest, callback: google.cloud.kms.v1.KeyManagementService.GetKeyRingCallback): void; - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { + /** + * Calls GetKeyRing. + * @param request GetKeyRingRequest message or plain object + * @returns Promise + */ + public getKeyRing(request: google.cloud.kms.v1.IGetKeyRingRequest): Promise; - /** EnumValueDescriptorProto name */ - name?: (string|null); + /** + * Calls GetCryptoKey. + * @param request GetCryptoKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKey + */ + public getCryptoKey(request: google.cloud.kms.v1.IGetCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyCallback): void; - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** + * Calls GetCryptoKey. + * @param request GetCryptoKeyRequest message or plain object + * @returns Promise + */ + public getCryptoKey(request: google.cloud.kms.v1.IGetCryptoKeyRequest): Promise; - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } + /** + * Calls GetCryptoKeyVersion. + * @param request GetCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public getCryptoKeyVersion(request: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersionCallback): void; - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** + * Calls GetCryptoKeyVersion. + * @param request GetCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public getCryptoKeyVersion(request: google.cloud.kms.v1.IGetCryptoKeyVersionRequest): Promise; - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + /** + * Calls GetPublicKey. + * @param request GetPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicKey + */ + public getPublicKey(request: google.cloud.kms.v1.IGetPublicKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.GetPublicKeyCallback): void; - /** EnumValueDescriptorProto name. */ - public name: string; + /** + * Calls GetPublicKey. + * @param request GetPublicKeyRequest message or plain object + * @returns Promise + */ + public getPublicKey(request: google.cloud.kms.v1.IGetPublicKeyRequest): Promise; - /** EnumValueDescriptorProto number. */ - public number: number; + /** + * Calls GetImportJob. + * @param request GetImportJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImportJob + */ + public getImportJob(request: google.cloud.kms.v1.IGetImportJobRequest, callback: google.cloud.kms.v1.KeyManagementService.GetImportJobCallback): void; - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** + * Calls GetImportJob. + * @param request GetImportJobRequest message or plain object + * @returns Promise + */ + public getImportJob(request: google.cloud.kms.v1.IGetImportJobRequest): Promise; - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + /** + * Calls CreateKeyRing. + * @param request CreateKeyRingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KeyRing + */ + public createKeyRing(request: google.cloud.kms.v1.ICreateKeyRingRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateKeyRingCallback): void; - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateKeyRing. + * @param request CreateKeyRingRequest message or plain object + * @returns Promise + */ + public createKeyRing(request: google.cloud.kms.v1.ICreateKeyRingRequest): Promise; - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateCryptoKey. + * @param request CreateCryptoKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKey + */ + public createCryptoKey(request: google.cloud.kms.v1.ICreateCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyCallback): void; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + /** + * Calls CreateCryptoKey. + * @param request CreateCryptoKeyRequest message or plain object + * @returns Promise + */ + public createCryptoKey(request: google.cloud.kms.v1.ICreateCryptoKeyRequest): Promise; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + /** + * Calls CreateCryptoKeyVersion. + * @param request CreateCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public createCryptoKeyVersion(request: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersionCallback): void; - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls CreateCryptoKeyVersion. + * @param request CreateCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public createCryptoKeyVersion(request: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest): Promise; - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + /** + * Calls ImportCryptoKeyVersion. + * @param request ImportCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public importCryptoKeyVersion(request: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersionCallback): void; - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls ImportCryptoKeyVersion. + * @param request ImportCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public importCryptoKeyVersion(request: google.cloud.kms.v1.IImportCryptoKeyVersionRequest): Promise; - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls CreateImportJob. + * @param request CreateImportJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImportJob + */ + public createImportJob(request: google.cloud.kms.v1.ICreateImportJobRequest, callback: google.cloud.kms.v1.KeyManagementService.CreateImportJobCallback): void; - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { + /** + * Calls CreateImportJob. + * @param request CreateImportJobRequest message or plain object + * @returns Promise + */ + public createImportJob(request: google.cloud.kms.v1.ICreateImportJobRequest): Promise; - /** ServiceDescriptorProto name */ - name?: (string|null); + /** + * Calls UpdateCryptoKey. + * @param request UpdateCryptoKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKey + */ + public updateCryptoKey(request: google.cloud.kms.v1.IUpdateCryptoKeyRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyCallback): void; - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** + * Calls UpdateCryptoKey. + * @param request UpdateCryptoKeyRequest message or plain object + * @returns Promise + */ + public updateCryptoKey(request: google.cloud.kms.v1.IUpdateCryptoKeyRequest): Promise; - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } + /** + * Calls UpdateCryptoKeyVersion. + * @param request UpdateCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public updateCryptoKeyVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersionCallback): void; - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** + * Calls UpdateCryptoKeyVersion. + * @param request UpdateCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public updateCryptoKeyVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest): Promise; - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); + /** + * Calls Encrypt. + * @param request EncryptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EncryptResponse + */ + public encrypt(request: google.cloud.kms.v1.IEncryptRequest, callback: google.cloud.kms.v1.KeyManagementService.EncryptCallback): void; - /** ServiceDescriptorProto name. */ - public name: string; + /** + * Calls Encrypt. + * @param request EncryptRequest message or plain object + * @returns Promise + */ + public encrypt(request: google.cloud.kms.v1.IEncryptRequest): Promise; - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** + * Calls Decrypt. + * @param request DecryptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DecryptResponse + */ + public decrypt(request: google.cloud.kms.v1.IDecryptRequest, callback: google.cloud.kms.v1.KeyManagementService.DecryptCallback): void; - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** + * Calls Decrypt. + * @param request DecryptRequest message or plain object + * @returns Promise + */ + public decrypt(request: google.cloud.kms.v1.IDecryptRequest): Promise; - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + /** + * Calls AsymmetricSign. + * @param request AsymmetricSignRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AsymmetricSignResponse + */ + public asymmetricSign(request: google.cloud.kms.v1.IAsymmetricSignRequest, callback: google.cloud.kms.v1.KeyManagementService.AsymmetricSignCallback): void; - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls AsymmetricSign. + * @param request AsymmetricSignRequest message or plain object + * @returns Promise + */ + public asymmetricSign(request: google.cloud.kms.v1.IAsymmetricSignRequest): Promise; - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls AsymmetricDecrypt. + * @param request AsymmetricDecryptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AsymmetricDecryptResponse + */ + public asymmetricDecrypt(request: google.cloud.kms.v1.IAsymmetricDecryptRequest, callback: google.cloud.kms.v1.KeyManagementService.AsymmetricDecryptCallback): void; - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + /** + * Calls AsymmetricDecrypt. + * @param request AsymmetricDecryptRequest message or plain object + * @returns Promise + */ + public asymmetricDecrypt(request: google.cloud.kms.v1.IAsymmetricDecryptRequest): Promise; - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + /** + * Calls UpdateCryptoKeyPrimaryVersion. + * @param request UpdateCryptoKeyPrimaryVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKey + */ + public updateCryptoKeyPrimaryVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersionCallback): void; - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls UpdateCryptoKeyPrimaryVersion. + * @param request UpdateCryptoKeyPrimaryVersionRequest message or plain object + * @returns Promise + */ + public updateCryptoKeyPrimaryVersion(request: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest): Promise; - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + /** + * Calls DestroyCryptoKeyVersion. + * @param request DestroyCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public destroyCryptoKeyVersion(request: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersionCallback): void; - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls DestroyCryptoKeyVersion. + * @param request DestroyCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public destroyCryptoKeyVersion(request: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest): Promise; - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls RestoreCryptoKeyVersion. + * @param request RestoreCryptoKeyVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CryptoKeyVersion + */ + public restoreCryptoKeyVersion(request: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, callback: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersionCallback): void; - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** + * Calls RestoreCryptoKeyVersion. + * @param request RestoreCryptoKeyVersionRequest message or plain object + * @returns Promise + */ + public restoreCryptoKeyVersion(request: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest): Promise; + } - /** MethodDescriptorProto name */ - name?: (string|null); + namespace KeyManagementService { - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listKeyRings}. + * @param error Error, if any + * @param [response] ListKeyRingsResponse + */ + type ListKeyRingsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListKeyRingsResponse) => void; - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeys}. + * @param error Error, if any + * @param [response] ListCryptoKeysResponse + */ + type ListCryptoKeysCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListCryptoKeysResponse) => void; - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeyVersions}. + * @param error Error, if any + * @param [response] ListCryptoKeyVersionsResponse + */ + type ListCryptoKeyVersionsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListCryptoKeyVersionsResponse) => void; - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listImportJobs}. + * @param error Error, if any + * @param [response] ListImportJobsResponse + */ + type ListImportJobsCallback = (error: (Error|null), response?: google.cloud.kms.v1.ListImportJobsResponse) => void; - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getKeyRing}. + * @param error Error, if any + * @param [response] KeyRing + */ + type GetKeyRingCallback = (error: (Error|null), response?: google.cloud.kms.v1.KeyRing) => void; - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKey}. + * @param error Error, if any + * @param [response] CryptoKey + */ + type GetCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type GetCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; - /** MethodDescriptorProto name. */ - public name: string; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getPublicKey}. + * @param error Error, if any + * @param [response] PublicKey + */ + type GetPublicKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.PublicKey) => void; - /** MethodDescriptorProto inputType. */ - public inputType: string; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getImportJob}. + * @param error Error, if any + * @param [response] ImportJob + */ + type GetImportJobCallback = (error: (Error|null), response?: google.cloud.kms.v1.ImportJob) => void; - /** MethodDescriptorProto outputType. */ - public outputType: string; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createKeyRing}. + * @param error Error, if any + * @param [response] KeyRing + */ + type CreateKeyRingCallback = (error: (Error|null), response?: google.cloud.kms.v1.KeyRing) => void; - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKey}. + * @param error Error, if any + * @param [response] CryptoKey + */ + type CreateCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type CreateCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#importCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type ImportCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createImportJob}. + * @param error Error, if any + * @param [response] ImportJob + */ + type CreateImportJobCallback = (error: (Error|null), response?: google.cloud.kms.v1.ImportJob) => void; - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKey}. + * @param error Error, if any + * @param [response] CryptoKey + */ + type UpdateCryptoKeyCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type UpdateCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#encrypt}. + * @param error Error, if any + * @param [response] EncryptResponse + */ + type EncryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.EncryptResponse) => void; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#decrypt}. + * @param error Error, if any + * @param [response] DecryptResponse + */ + type DecryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.DecryptResponse) => void; - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricSign}. + * @param error Error, if any + * @param [response] AsymmetricSignResponse + */ + type AsymmetricSignCallback = (error: (Error|null), response?: google.cloud.kms.v1.AsymmetricSignResponse) => void; - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricDecrypt}. + * @param error Error, if any + * @param [response] AsymmetricDecryptResponse + */ + type AsymmetricDecryptCallback = (error: (Error|null), response?: google.cloud.kms.v1.AsymmetricDecryptResponse) => void; - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyPrimaryVersion}. + * @param error Error, if any + * @param [response] CryptoKey + */ + type UpdateCryptoKeyPrimaryVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKey) => void; - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#destroyCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type DestroyCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; - /** Properties of a FileOptions. */ - interface IFileOptions { + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#restoreCryptoKeyVersion}. + * @param error Error, if any + * @param [response] CryptoKeyVersion + */ + type RestoreCryptoKeyVersionCallback = (error: (Error|null), response?: google.cloud.kms.v1.CryptoKeyVersion) => void; + } - /** FileOptions javaPackage */ - javaPackage?: (string|null); + /** Properties of a ListKeyRingsRequest. */ + interface IListKeyRingsRequest { - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); + /** ListKeyRingsRequest parent */ + parent?: (string|null); - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); + /** ListKeyRingsRequest pageSize */ + pageSize?: (number|null); - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); + /** ListKeyRingsRequest pageToken */ + pageToken?: (string|null); - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); + /** ListKeyRingsRequest filter */ + filter?: (string|null); - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + /** ListKeyRingsRequest orderBy */ + orderBy?: (string|null); + } - /** FileOptions goPackage */ - goPackage?: (string|null); + /** Represents a ListKeyRingsRequest. */ + class ListKeyRingsRequest implements IListKeyRingsRequest { - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); + /** + * Constructs a new ListKeyRingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListKeyRingsRequest); - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); + /** ListKeyRingsRequest parent. */ + public parent: string; - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); + /** ListKeyRingsRequest pageSize. */ + public pageSize: number; - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); + /** ListKeyRingsRequest pageToken. */ + public pageToken: string; - /** FileOptions deprecated */ - deprecated?: (boolean|null); + /** ListKeyRingsRequest filter. */ + public filter: string; - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); + /** ListKeyRingsRequest orderBy. */ + public orderBy: string; - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); + /** + * Creates a new ListKeyRingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeyRingsRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IListKeyRingsRequest): google.cloud.kms.v1.ListKeyRingsRequest; - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); + /** + * Encodes the specified ListKeyRingsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. + * @param message ListKeyRingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListKeyRingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); + /** + * Encodes the specified ListKeyRingsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. + * @param message ListKeyRingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListKeyRingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); + /** + * Decodes a ListKeyRingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeyRingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListKeyRingsRequest; - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** + * Decodes a ListKeyRingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeyRingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListKeyRingsRequest; - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** + * Verifies a ListKeyRingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** + * Creates a ListKeyRingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeyRingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListKeyRingsRequest; - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Creates a plain object from a ListKeyRingsRequest message. Also converts values to other types if specified. + * @param message ListKeyRingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListKeyRingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } + /** + * Converts this ListKeyRingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** Properties of a ListCryptoKeysRequest. */ + interface IListCryptoKeysRequest { - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); + /** ListCryptoKeysRequest parent */ + parent?: (string|null); - /** FileOptions javaPackage. */ - public javaPackage: string; + /** ListCryptoKeysRequest pageSize */ + pageSize?: (number|null); - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** ListCryptoKeysRequest pageToken */ + pageToken?: (string|null); - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + /** ListCryptoKeysRequest versionView */ + versionView?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null); - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** ListCryptoKeysRequest filter */ + filter?: (string|null); - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** ListCryptoKeysRequest orderBy */ + orderBy?: (string|null); + } - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** Represents a ListCryptoKeysRequest. */ + class ListCryptoKeysRequest implements IListCryptoKeysRequest { - /** FileOptions goPackage. */ - public goPackage: string; + /** + * Constructs a new ListCryptoKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListCryptoKeysRequest); - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** ListCryptoKeysRequest parent. */ + public parent: string; - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** ListCryptoKeysRequest pageSize. */ + public pageSize: number; - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** ListCryptoKeysRequest pageToken. */ + public pageToken: string; - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** ListCryptoKeysRequest versionView. */ + public versionView: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView); - /** FileOptions deprecated. */ - public deprecated: boolean; + /** ListCryptoKeysRequest filter. */ + public filter: string; - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** ListCryptoKeysRequest orderBy. */ + public orderBy: string; - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * Creates a new ListCryptoKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCryptoKeysRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IListCryptoKeysRequest): google.cloud.kms.v1.ListCryptoKeysRequest; - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** + * Encodes the specified ListCryptoKeysRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. + * @param message ListCryptoKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListCryptoKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** + * Encodes the specified ListCryptoKeysRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. + * @param message ListCryptoKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** + * Decodes a ListCryptoKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCryptoKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeysRequest; - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** + * Decodes a ListCryptoKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCryptoKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeysRequest; - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** + * Verifies a ListCryptoKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** + * Creates a ListCryptoKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCryptoKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeysRequest; - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a plain object from a ListCryptoKeysRequest message. Also converts values to other types if specified. + * @param message ListCryptoKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListCryptoKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + /** + * Converts this ListCryptoKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ListCryptoKeyVersionsRequest. */ + interface IListCryptoKeyVersionsRequest { - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCryptoKeyVersionsRequest parent */ + parent?: (string|null); - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + /** ListCryptoKeyVersionsRequest pageSize */ + pageSize?: (number|null); - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + /** ListCryptoKeyVersionsRequest pageToken */ + pageToken?: (string|null); - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListCryptoKeyVersionsRequest view */ + view?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null); - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + /** ListCryptoKeyVersionsRequest filter */ + filter?: (string|null); - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListCryptoKeyVersionsRequest orderBy */ + orderBy?: (string|null); + } - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a ListCryptoKeyVersionsRequest. */ + class ListCryptoKeyVersionsRequest implements IListCryptoKeyVersionsRequest { - namespace FileOptions { + /** + * Constructs a new ListCryptoKeyVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsRequest); - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } + /** ListCryptoKeyVersionsRequest parent. */ + public parent: string; - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** ListCryptoKeyVersionsRequest pageSize. */ + public pageSize: number; - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** ListCryptoKeyVersionsRequest pageToken. */ + public pageToken: string; - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** ListCryptoKeyVersionsRequest view. */ + public view: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView); - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** ListCryptoKeyVersionsRequest filter. */ + public filter: string; - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** ListCryptoKeyVersionsRequest orderBy. */ + public orderBy: string; - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Creates a new ListCryptoKeyVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCryptoKeyVersionsRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsRequest): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } + /** + * Encodes the specified ListCryptoKeyVersionsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. + * @param message ListCryptoKeyVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** + * Encodes the specified ListCryptoKeyVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. + * @param message ListCryptoKeyVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeyVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); + /** + * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCryptoKeyVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; + /** + * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCryptoKeyVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; + /** + * Verifies a ListCryptoKeyVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MessageOptions deprecated. */ - public deprecated: boolean; + /** + * Creates a ListCryptoKeyVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCryptoKeyVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeyVersionsRequest; - /** MessageOptions mapEntry. */ - public mapEntry: boolean; + /** + * Creates a plain object from a ListCryptoKeyVersionsRequest message. Also converts values to other types if specified. + * @param message ListCryptoKeyVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListCryptoKeyVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Converts this ListCryptoKeyVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + /** Properties of a ListImportJobsRequest. */ + interface IListImportJobsRequest { - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListImportJobsRequest parent */ + parent?: (string|null); - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListImportJobsRequest pageSize */ + pageSize?: (number|null); - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + /** ListImportJobsRequest pageToken */ + pageToken?: (string|null); - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + /** ListImportJobsRequest filter */ + filter?: (string|null); - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListImportJobsRequest orderBy */ + orderBy?: (string|null); + } - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + /** Represents a ListImportJobsRequest. */ + class ListImportJobsRequest implements IListImportJobsRequest { - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ListImportJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListImportJobsRequest); - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListImportJobsRequest parent. */ + public parent: string; - /** Properties of a FieldOptions. */ - interface IFieldOptions { + /** ListImportJobsRequest pageSize. */ + public pageSize: number; - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** ListImportJobsRequest pageToken. */ + public pageToken: string; - /** FieldOptions packed */ - packed?: (boolean|null); + /** ListImportJobsRequest filter. */ + public filter: string; - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** ListImportJobsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListImportJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListImportJobsRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IListImportJobsRequest): google.cloud.kms.v1.ListImportJobsRequest; - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** + * Encodes the specified ListImportJobsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. + * @param message ListImportJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListImportJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** + * Encodes the specified ListImportJobsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. + * @param message ListImportJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListImportJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions weak */ - weak?: (boolean|null); + /** + * Decodes a ListImportJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListImportJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListImportJobsRequest; - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Decodes a ListImportJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListImportJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListImportJobsRequest; - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** + * Verifies a ListImportJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } + /** + * Creates a ListImportJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListImportJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListImportJobsRequest; - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** + * Creates a plain object from a ListImportJobsRequest message. Also converts values to other types if specified. + * @param message ListImportJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListImportJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); + /** + * Converts this ListImportJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + /** Properties of a ListKeyRingsResponse. */ + interface IListKeyRingsResponse { - /** FieldOptions packed. */ - public packed: boolean; + /** ListKeyRingsResponse keyRings */ + keyRings?: (google.cloud.kms.v1.IKeyRing[]|null); - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + /** ListKeyRingsResponse nextPageToken */ + nextPageToken?: (string|null); - /** FieldOptions lazy. */ - public lazy: boolean; + /** ListKeyRingsResponse totalSize */ + totalSize?: (number|null); + } - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** Represents a ListKeyRingsResponse. */ + class ListKeyRingsResponse implements IListKeyRingsResponse { - /** FieldOptions weak. */ - public weak: boolean; + /** + * Constructs a new ListKeyRingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListKeyRingsResponse); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** ListKeyRingsResponse keyRings. */ + public keyRings: google.cloud.kms.v1.IKeyRing[]; - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + /** ListKeyRingsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListKeyRingsResponse totalSize. */ + public totalSize: number; - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListKeyRingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeyRingsResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IListKeyRingsResponse): google.cloud.kms.v1.ListKeyRingsResponse; - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + /** + * Encodes the specified ListKeyRingsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. + * @param message ListKeyRingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListKeyRingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + /** + * Encodes the specified ListKeyRingsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. + * @param message ListKeyRingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListKeyRingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListKeyRingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeyRingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListKeyRingsResponse; - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + /** + * Decodes a ListKeyRingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeyRingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListKeyRingsResponse; - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListKeyRingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ListKeyRingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeyRingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListKeyRingsResponse; - namespace FieldOptions { + /** + * Creates a plain object from a ListKeyRingsResponse message. Also converts values to other types if specified. + * @param message ListKeyRingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListKeyRingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } + /** + * Converts this ListKeyRingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } + /** Properties of a ListCryptoKeysResponse. */ + interface IListCryptoKeysResponse { - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** ListCryptoKeysResponse cryptoKeys */ + cryptoKeys?: (google.cloud.kms.v1.ICryptoKey[]|null); - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** ListCryptoKeysResponse nextPageToken */ + nextPageToken?: (string|null); - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** ListCryptoKeysResponse totalSize */ + totalSize?: (number|null); + } - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); + /** Represents a ListCryptoKeysResponse. */ + class ListCryptoKeysResponse implements IListCryptoKeysResponse { - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Constructs a new ListCryptoKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListCryptoKeysResponse); - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + /** ListCryptoKeysResponse cryptoKeys. */ + public cryptoKeys: google.cloud.kms.v1.ICryptoKey[]; - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCryptoKeysResponse nextPageToken. */ + public nextPageToken: string; - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCryptoKeysResponse totalSize. */ + public totalSize: number; - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + /** + * Creates a new ListCryptoKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCryptoKeysResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IListCryptoKeysResponse): google.cloud.kms.v1.ListCryptoKeysResponse; - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + /** + * Encodes the specified ListCryptoKeysResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. + * @param message ListCryptoKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListCryptoKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListCryptoKeysResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. + * @param message ListCryptoKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + /** + * Decodes a ListCryptoKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCryptoKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeysResponse; - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListCryptoKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCryptoKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeysResponse; - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a ListCryptoKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of an EnumOptions. */ - interface IEnumOptions { + /** + * Creates a ListCryptoKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCryptoKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeysResponse; - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); + /** + * Creates a plain object from a ListCryptoKeysResponse message. Also converts values to other types if specified. + * @param message ListCryptoKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListCryptoKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** + * Converts this ListCryptoKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** Properties of a ListCryptoKeyVersionsResponse. */ + interface IListCryptoKeyVersionsResponse { - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** ListCryptoKeyVersionsResponse cryptoKeyVersions */ + cryptoKeyVersions?: (google.cloud.kms.v1.ICryptoKeyVersion[]|null); - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); + /** ListCryptoKeyVersionsResponse nextPageToken */ + nextPageToken?: (string|null); - /** EnumOptions allowAlias. */ - public allowAlias: boolean; + /** ListCryptoKeyVersionsResponse totalSize */ + totalSize?: (number|null); + } - /** EnumOptions deprecated. */ - public deprecated: boolean; + /** Represents a ListCryptoKeyVersionsResponse. */ + class ListCryptoKeyVersionsResponse implements IListCryptoKeyVersionsResponse { - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Constructs a new ListCryptoKeyVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsResponse); - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + /** ListCryptoKeyVersionsResponse cryptoKeyVersions. */ + public cryptoKeyVersions: google.cloud.kms.v1.ICryptoKeyVersion[]; - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCryptoKeyVersionsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCryptoKeyVersionsResponse totalSize. */ + public totalSize: number; - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + /** + * Creates a new ListCryptoKeyVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCryptoKeyVersionsResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IListCryptoKeyVersionsResponse): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + /** + * Encodes the specified ListCryptoKeyVersionsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. + * @param message ListCryptoKeyVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListCryptoKeyVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCryptoKeyVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. + * @param message ListCryptoKeyVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListCryptoKeyVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCryptoKeyVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + /** + * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCryptoKeyVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListCryptoKeyVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ListCryptoKeyVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCryptoKeyVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListCryptoKeyVersionsResponse; - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** + * Creates a plain object from a ListCryptoKeyVersionsResponse message. Also converts values to other types if specified. + * @param message ListCryptoKeyVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListCryptoKeyVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** + * Converts this ListCryptoKeyVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** Properties of a ListImportJobsResponse. */ + interface IListImportJobsResponse { - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** ListImportJobsResponse importJobs */ + importJobs?: (google.cloud.kms.v1.IImportJob[]|null); - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); + /** ListImportJobsResponse nextPageToken */ + nextPageToken?: (string|null); - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** ListImportJobsResponse totalSize */ + totalSize?: (number|null); + } - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Represents a ListImportJobsResponse. */ + class ListImportJobsResponse implements IListImportJobsResponse { - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + /** + * Constructs a new ListImportJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IListImportJobsResponse); - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListImportJobsResponse importJobs. */ + public importJobs: google.cloud.kms.v1.IImportJob[]; - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListImportJobsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + /** ListImportJobsResponse totalSize. */ + public totalSize: number; - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + /** + * Creates a new ListImportJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListImportJobsResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IListImportJobsResponse): google.cloud.kms.v1.ListImportJobsResponse; - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListImportJobsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. + * @param message ListImportJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IListImportJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + /** + * Encodes the specified ListImportJobsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. + * @param message ListImportJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IListImportJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListImportJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListImportJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ListImportJobsResponse; - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListImportJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListImportJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ListImportJobsResponse; - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** + * Verifies a ListImportJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** + * Creates a ListImportJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListImportJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ListImportJobsResponse; - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Creates a plain object from a ListImportJobsResponse message. Also converts values to other types if specified. + * @param message ListImportJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ListImportJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** + * Converts this ListImportJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } + /** Properties of a GetKeyRingRequest. */ + interface IGetKeyRingRequest { - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** GetKeyRingRequest name */ + name?: (string|null); + } + + /** Represents a GetKeyRingRequest. */ + class GetKeyRingRequest implements IGetKeyRingRequest { - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); + /** + * Constructs a new GetKeyRingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetKeyRingRequest); - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** GetKeyRingRequest name. */ + public name: string; - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new GetKeyRingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetKeyRingRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetKeyRingRequest): google.cloud.kms.v1.GetKeyRingRequest; - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + /** + * Encodes the specified GetKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. + * @param message GetKeyRingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GetKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. + * @param message GetKeyRingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a GetKeyRingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetKeyRingRequest; - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + /** + * Decodes a GetKeyRingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetKeyRingRequest; - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + /** + * Verifies a GetKeyRingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a GetKeyRingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetKeyRingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetKeyRingRequest; - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + /** + * Creates a plain object from a GetKeyRingRequest message. Also converts values to other types if specified. + * @param message GetKeyRingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetKeyRingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this GetKeyRingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a GetCryptoKeyRequest. */ + interface IGetCryptoKeyRequest { - /** Properties of a MethodOptions. */ - interface IMethodOptions { + /** GetCryptoKeyRequest name */ + name?: (string|null); + } - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** Represents a GetCryptoKeyRequest. */ + class GetCryptoKeyRequest implements IGetCryptoKeyRequest { - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** + * Constructs a new GetCryptoKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetCryptoKeyRequest); - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** GetCryptoKeyRequest name. */ + public name: string; - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** + * Creates a new GetCryptoKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCryptoKeyRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetCryptoKeyRequest): google.cloud.kms.v1.GetCryptoKeyRequest; - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } + /** + * Encodes the specified GetCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. + * @param message GetCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** + * Encodes the specified GetCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. + * @param message GetCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); + /** + * Decodes a GetCryptoKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetCryptoKeyRequest; - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** + * Decodes a GetCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetCryptoKeyRequest; - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** + * Verifies a GetCryptoKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a GetCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCryptoKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetCryptoKeyRequest; - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + /** + * Creates a plain object from a GetCryptoKeyRequest message. Also converts values to other types if specified. + * @param message GetCryptoKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this GetCryptoKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a GetCryptoKeyVersionRequest. */ + interface IGetCryptoKeyVersionRequest { - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + /** GetCryptoKeyVersionRequest name */ + name?: (string|null); + } - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + /** Represents a GetCryptoKeyVersionRequest. */ + class GetCryptoKeyVersionRequest implements IGetCryptoKeyVersionRequest { - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new GetCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetCryptoKeyVersionRequest); - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + /** GetCryptoKeyVersionRequest name. */ + public name: string; - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new GetCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetCryptoKeyVersionRequest): google.cloud.kms.v1.GetCryptoKeyVersionRequest; - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified GetCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. + * @param message GetCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - namespace MethodOptions { + /** + * Encodes the specified GetCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. + * @param message GetCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } + /** + * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetCryptoKeyVersionRequest; - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** + * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetCryptoKeyVersionRequest; - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** + * Verifies a GetCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** + * Creates a GetCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetCryptoKeyVersionRequest; - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** + * Creates a plain object from a GetCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message GetCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** + * Converts this GetCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** Properties of a GetPublicKeyRequest. */ + interface IGetPublicKeyRequest { - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** GetPublicKeyRequest name */ + name?: (string|null); + } - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } + /** Represents a GetPublicKeyRequest. */ + class GetPublicKeyRequest implements IGetPublicKeyRequest { - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** + * Constructs a new GetPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetPublicKeyRequest); - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); + /** GetPublicKeyRequest name. */ + public name: string; - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** + * Creates a new GetPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPublicKeyRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetPublicKeyRequest): google.cloud.kms.v1.GetPublicKeyRequest; - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** + * Encodes the specified GetPublicKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. + * @param message GetPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** + * Encodes the specified GetPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. + * @param message GetPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** + * Decodes a GetPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetPublicKeyRequest; - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** + * Decodes a GetPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetPublicKeyRequest; - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** + * Verifies a GetPublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** + * Creates a GetPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetPublicKeyRequest; - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + /** + * Creates a plain object from a GetPublicKeyRequest message. Also converts values to other types if specified. + * @param message GetPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this GetPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a GetImportJobRequest. */ + interface IGetImportJobRequest { - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + /** GetImportJobRequest name */ + name?: (string|null); + } - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + /** Represents a GetImportJobRequest. */ + class GetImportJobRequest implements IGetImportJobRequest { - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new GetImportJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IGetImportJobRequest); - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + /** GetImportJobRequest name. */ + public name: string; - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new GetImportJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetImportJobRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IGetImportJobRequest): google.cloud.kms.v1.GetImportJobRequest; - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified GetImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. + * @param message GetImportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IGetImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - namespace UninterpretedOption { + /** + * Encodes the specified GetImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. + * @param message GetImportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IGetImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a NamePart. */ - interface INamePart { + /** + * Decodes a GetImportJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.GetImportJobRequest; - /** NamePart namePart */ - namePart: string; + /** + * Decodes a GetImportJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.GetImportJobRequest; - /** NamePart isExtension */ - isExtension: boolean; - } + /** + * Verifies a GetImportJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** + * Creates a GetImportJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetImportJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.GetImportJobRequest; - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + /** + * Creates a plain object from a GetImportJobRequest message. Also converts values to other types if specified. + * @param message GetImportJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.GetImportJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** NamePart namePart. */ - public namePart: string; + /** + * Converts this GetImportJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** NamePart isExtension. */ - public isExtension: boolean; + /** Properties of a CreateKeyRingRequest. */ + interface ICreateKeyRingRequest { - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + /** CreateKeyRingRequest parent */ + parent?: (string|null); - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateKeyRingRequest keyRingId */ + keyRingId?: (string|null); - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateKeyRingRequest keyRing */ + keyRing?: (google.cloud.kms.v1.IKeyRing|null); + } - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + /** Represents a CreateKeyRingRequest. */ + class CreateKeyRingRequest implements ICreateKeyRingRequest { - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + /** + * Constructs a new CreateKeyRingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICreateKeyRingRequest); - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CreateKeyRingRequest parent. */ + public parent: string; - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + /** CreateKeyRingRequest keyRingId. */ + public keyRingId: string; - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CreateKeyRingRequest keyRing. */ + public keyRing?: (google.cloud.kms.v1.IKeyRing|null); - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a new CreateKeyRingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateKeyRingRequest instance + */ + public static create(properties?: google.cloud.kms.v1.ICreateKeyRingRequest): google.cloud.kms.v1.CreateKeyRingRequest; - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** + * Encodes the specified CreateKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. + * @param message CreateKeyRingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICreateKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. + * @param message CreateKeyRingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICreateKeyRingRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } + /** + * Decodes a CreateKeyRingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateKeyRingRequest; - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** + * Decodes a CreateKeyRingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateKeyRingRequest; - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + /** + * Verifies a CreateKeyRingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** + * Creates a CreateKeyRingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateKeyRingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateKeyRingRequest; - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + /** + * Creates a plain object from a CreateKeyRingRequest message. Also converts values to other types if specified. + * @param message CreateKeyRingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CreateKeyRingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this CreateKeyRingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a CreateCryptoKeyRequest. */ + interface ICreateCryptoKeyRequest { - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + /** CreateCryptoKeyRequest parent */ + parent?: (string|null); - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + /** CreateCryptoKeyRequest cryptoKeyId */ + cryptoKeyId?: (string|null); - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CreateCryptoKeyRequest cryptoKey */ + cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + /** CreateCryptoKeyRequest skipInitialVersionCreation */ + skipInitialVersionCreation?: (boolean|null); + } - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a CreateCryptoKeyRequest. */ + class CreateCryptoKeyRequest implements ICreateCryptoKeyRequest { - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new CreateCryptoKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICreateCryptoKeyRequest); - namespace SourceCodeInfo { + /** CreateCryptoKeyRequest parent. */ + public parent: string; - /** Properties of a Location. */ - interface ILocation { + /** CreateCryptoKeyRequest cryptoKeyId. */ + public cryptoKeyId: string; - /** Location path */ - path?: (number[]|null); + /** CreateCryptoKeyRequest cryptoKey. */ + public cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); - /** Location span */ - span?: (number[]|null); + /** CreateCryptoKeyRequest skipInitialVersionCreation. */ + public skipInitialVersionCreation: boolean; - /** Location leadingComments */ - leadingComments?: (string|null); + /** + * Creates a new CreateCryptoKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCryptoKeyRequest instance + */ + public static create(properties?: google.cloud.kms.v1.ICreateCryptoKeyRequest): google.cloud.kms.v1.CreateCryptoKeyRequest; - /** Location trailingComments */ - trailingComments?: (string|null); + /** + * Encodes the specified CreateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. + * @param message CreateCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICreateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } + /** + * Encodes the specified CreateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. + * @param message CreateCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICreateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Location. */ - class Location implements ILocation { + /** + * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateCryptoKeyRequest; - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** + * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateCryptoKeyRequest; - /** Location path. */ - public path: number[]; + /** + * Verifies a CreateCryptoKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Location span. */ - public span: number[]; + /** + * Creates a CreateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCryptoKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateCryptoKeyRequest; - /** Location leadingComments. */ - public leadingComments: string; + /** + * Creates a plain object from a CreateCryptoKeyRequest message. Also converts values to other types if specified. + * @param message CreateCryptoKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CreateCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Location trailingComments. */ - public trailingComments: string; + /** + * Converts this CreateCryptoKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** Properties of a CreateCryptoKeyVersionRequest. */ + interface ICreateCryptoKeyVersionRequest { - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + /** CreateCryptoKeyVersionRequest parent */ + parent?: (string|null); - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateCryptoKeyVersionRequest cryptoKeyVersion */ + cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); + } + + /** Represents a CreateCryptoKeyVersionRequest. */ + class CreateCryptoKeyVersionRequest implements ICreateCryptoKeyVersionRequest { - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new CreateCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest); - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + /** CreateCryptoKeyVersionRequest parent. */ + public parent: string; - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + /** CreateCryptoKeyVersionRequest cryptoKeyVersion. */ + public cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new CreateCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + /** + * Encodes the specified CreateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. + * @param message CreateCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified CreateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. + * @param message CreateCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** + * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } + /** + * Verifies a CreateCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** + * Creates a CreateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateCryptoKeyVersionRequest; - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + /** + * Creates a plain object from a CreateCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message CreateCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CreateCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** + * Converts this CreateCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + /** Properties of an ImportCryptoKeyVersionRequest. */ + interface IImportCryptoKeyVersionRequest { - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportCryptoKeyVersionRequest parent */ + parent?: (string|null); - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportCryptoKeyVersionRequest algorithm */ + algorithm?: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null); - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + /** ImportCryptoKeyVersionRequest importJob */ + importJob?: (string|null); - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + /** ImportCryptoKeyVersionRequest rsaAesWrappedKey */ + rsaAesWrappedKey?: (Uint8Array|string|null); + } - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents an ImportCryptoKeyVersionRequest. */ + class ImportCryptoKeyVersionRequest implements IImportCryptoKeyVersionRequest { - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + /** + * Constructs a new ImportCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IImportCryptoKeyVersionRequest); - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportCryptoKeyVersionRequest parent. */ + public parent: string; - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImportCryptoKeyVersionRequest algorithm. */ + public algorithm: (google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|keyof typeof google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm); - namespace GeneratedCodeInfo { + /** ImportCryptoKeyVersionRequest importJob. */ + public importJob: string; - /** Properties of an Annotation. */ - interface IAnnotation { + /** ImportCryptoKeyVersionRequest rsaAesWrappedKey. */ + public rsaAesWrappedKey: (Uint8Array|string); - /** Annotation path */ - path?: (number[]|null); + /** ImportCryptoKeyVersionRequest wrappedKeyMaterial. */ + public wrappedKeyMaterial?: "rsaAesWrappedKey"; - /** Annotation sourceFile */ - sourceFile?: (string|null); + /** + * Creates a new ImportCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IImportCryptoKeyVersionRequest): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; - /** Annotation begin */ - begin?: (number|null); + /** + * Encodes the specified ImportCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. + * @param message ImportCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Annotation end */ - end?: (number|null); - } + /** + * Encodes the specified ImportCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. + * @param message ImportCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IImportCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an Annotation. */ - class Annotation implements IAnnotation { + /** + * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + /** + * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; - /** Annotation path. */ - public path: number[]; + /** + * Verifies an ImportCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Annotation sourceFile. */ - public sourceFile: string; + /** + * Creates an ImportCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.ImportCryptoKeyVersionRequest; - /** Annotation begin. */ - public begin: number; + /** + * Creates a plain object from an ImportCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message ImportCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.ImportCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Annotation end. */ - public end: number; + /** + * Converts this ImportCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + /** Properties of a CreateImportJobRequest. */ + interface ICreateImportJobRequest { - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateImportJobRequest parent */ + parent?: (string|null); - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateImportJobRequest importJobId */ + importJobId?: (string|null); - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + /** CreateImportJobRequest importJob */ + importJob?: (google.cloud.kms.v1.IImportJob|null); + } - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + /** Represents a CreateImportJobRequest. */ + class CreateImportJobRequest implements ICreateImportJobRequest { - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new CreateImportJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ICreateImportJobRequest); - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + /** CreateImportJobRequest parent. */ + public parent: string; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CreateImportJobRequest importJobId. */ + public importJobId: string; - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** CreateImportJobRequest importJob. */ + public importJob?: (google.cloud.kms.v1.IImportJob|null); - /** Properties of a Duration. */ - interface IDuration { + /** + * Creates a new CreateImportJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateImportJobRequest instance + */ + public static create(properties?: google.cloud.kms.v1.ICreateImportJobRequest): google.cloud.kms.v1.CreateImportJobRequest; - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** + * Encodes the specified CreateImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. + * @param message CreateImportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ICreateImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Duration nanos */ - nanos?: (number|null); - } + /** + * Encodes the specified CreateImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. + * @param message CreateImportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ICreateImportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Duration. */ - class Duration implements IDuration { + /** + * Decodes a CreateImportJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.CreateImportJobRequest; - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); + /** + * Decodes a CreateImportJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.CreateImportJobRequest; - /** Duration seconds. */ - public seconds: (number|Long|string); + /** + * Verifies a CreateImportJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Duration nanos. */ - public nanos: number; + /** + * Creates a CreateImportJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateImportJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.CreateImportJobRequest; - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + /** + * Creates a plain object from a CreateImportJobRequest message. Also converts values to other types if specified. + * @param message CreateImportJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.CreateImportJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this CreateImportJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an UpdateCryptoKeyRequest. */ + interface IUpdateCryptoKeyRequest { - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + /** UpdateCryptoKeyRequest cryptoKey */ + cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + /** UpdateCryptoKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents an UpdateCryptoKeyRequest. */ + class UpdateCryptoKeyRequest implements IUpdateCryptoKeyRequest { - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + /** + * Constructs a new UpdateCryptoKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyRequest); - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UpdateCryptoKeyRequest cryptoKey. */ + public cryptoKey?: (google.cloud.kms.v1.ICryptoKey|null); - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UpdateCryptoKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Properties of a Timestamp. */ - interface ITimestamp { + /** + * Creates a new UpdateCryptoKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCryptoKeyRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyRequest): google.cloud.kms.v1.UpdateCryptoKeyRequest; - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** + * Encodes the specified UpdateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. + * @param message UpdateCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Timestamp nanos */ - nanos?: (number|null); - } + /** + * Encodes the specified UpdateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. + * @param message UpdateCryptoKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** + * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyRequest; - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); + /** + * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyRequest; - /** Timestamp seconds. */ - public seconds: (number|Long|string); + /** + * Verifies an UpdateCryptoKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Timestamp nanos. */ - public nanos: number; + /** + * Creates an UpdateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCryptoKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyRequest; - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + /** + * Creates a plain object from an UpdateCryptoKeyRequest message. Also converts values to other types if specified. + * @param message UpdateCryptoKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this UpdateCryptoKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an UpdateCryptoKeyVersionRequest. */ + interface IUpdateCryptoKeyVersionRequest { - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + /** UpdateCryptoKeyVersionRequest cryptoKeyVersion */ + cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + /** UpdateCryptoKeyVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents an UpdateCryptoKeyVersionRequest. */ + class UpdateCryptoKeyVersionRequest implements IUpdateCryptoKeyVersionRequest { - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + /** + * Constructs a new UpdateCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest); - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UpdateCryptoKeyVersionRequest cryptoKeyVersion. */ + public cryptoKeyVersion?: (google.cloud.kms.v1.ICryptoKeyVersion|null); - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UpdateCryptoKeyVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Properties of a FieldMask. */ - interface IFieldMask { + /** + * Creates a new UpdateCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; - /** FieldMask paths */ - paths?: (string[]|null); - } + /** + * Encodes the specified UpdateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. + * @param message UpdateCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** + * Encodes the specified UpdateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. + * @param message UpdateCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); + /** + * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; - /** FieldMask paths. */ - public paths: string[]; + /** + * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + /** + * Verifies an UpdateCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an UpdateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an UpdateCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message UpdateCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + /** + * Converts this UpdateCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + /** Properties of an EncryptRequest. */ + interface IEncryptRequest { - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EncryptRequest name */ + name?: (string|null); - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + /** EncryptRequest plaintext */ + plaintext?: (Uint8Array|string|null); - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EncryptRequest additionalAuthenticatedData */ + additionalAuthenticatedData?: (Uint8Array|string|null); + } - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Represents an EncryptRequest. */ + class EncryptRequest implements IEncryptRequest { - /** Namespace iam. */ - namespace iam { + /** + * Constructs a new EncryptRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IEncryptRequest); - /** Namespace v1. */ - namespace v1 { + /** EncryptRequest name. */ + public name: string; - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { + /** EncryptRequest plaintext. */ + public plaintext: (Uint8Array|string); - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** EncryptRequest additionalAuthenticatedData. */ + public additionalAuthenticatedData: (Uint8Array|string); - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + /** + * Creates a new EncryptRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IEncryptRequest): google.cloud.kms.v1.EncryptRequest; - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + /** + * Encodes the specified EncryptRequest message. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. + * @param message EncryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IEncryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + /** + * Encodes the specified EncryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. + * @param message EncryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IEncryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + /** + * Decodes an EncryptRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.EncryptRequest; - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + /** + * Decodes an EncryptRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.EncryptRequest; - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + /** + * Verifies an EncryptRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } + /** + * Creates an EncryptRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.EncryptRequest; - namespace IAMPolicy { + /** + * Creates a plain object from an EncryptRequest message. Also converts values to other types if specified. + * @param message EncryptRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.EncryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** + * Converts this EncryptRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** Properties of a DecryptRequest. */ + interface IDecryptRequest { - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } + /** DecryptRequest name */ + name?: (string|null); - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { + /** DecryptRequest ciphertext */ + ciphertext?: (Uint8Array|string|null); - /** SetIamPolicyRequest resource */ - resource?: (string|null); + /** DecryptRequest additionalAuthenticatedData */ + additionalAuthenticatedData?: (Uint8Array|string|null); + } - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - } + /** Represents a DecryptRequest. */ + class DecryptRequest implements IDecryptRequest { - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { + /** + * Constructs a new DecryptRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IDecryptRequest); - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + /** DecryptRequest name. */ + public name: string; - /** SetIamPolicyRequest resource. */ - public resource: string; + /** DecryptRequest ciphertext. */ + public ciphertext: (Uint8Array|string); - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** DecryptRequest additionalAuthenticatedData. */ + public additionalAuthenticatedData: (Uint8Array|string); - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + /** + * Creates a new DecryptRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DecryptRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IDecryptRequest): google.cloud.kms.v1.DecryptRequest; - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. + * @param message DecryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. + * @param message DecryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + /** + * Decodes a DecryptRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DecryptRequest; - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + /** + * Decodes a DecryptRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DecryptRequest; - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a DecryptRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + /** + * Creates a DecryptRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecryptRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DecryptRequest; - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a DecryptRequest message. Also converts values to other types if specified. + * @param message DecryptRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.DecryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this DecryptRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { + /** Properties of an AsymmetricSignRequest. */ + interface IAsymmetricSignRequest { - /** GetIamPolicyRequest resource */ - resource?: (string|null); - } + /** AsymmetricSignRequest name */ + name?: (string|null); - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { + /** AsymmetricSignRequest digest */ + digest?: (google.cloud.kms.v1.IDigest|null); + } - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + /** Represents an AsymmetricSignRequest. */ + class AsymmetricSignRequest implements IAsymmetricSignRequest { - /** GetIamPolicyRequest resource. */ - public resource: string; + /** + * Constructs a new AsymmetricSignRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IAsymmetricSignRequest); - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + /** AsymmetricSignRequest name. */ + public name: string; - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** AsymmetricSignRequest digest. */ + public digest?: (google.cloud.kms.v1.IDigest|null); - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new AsymmetricSignRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricSignRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IAsymmetricSignRequest): google.cloud.kms.v1.AsymmetricSignRequest; - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + /** + * Encodes the specified AsymmetricSignRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. + * @param message AsymmetricSignRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IAsymmetricSignRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + /** + * Encodes the specified AsymmetricSignRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. + * @param message AsymmetricSignRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricSignRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsymmetricSignRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricSignRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricSignRequest; - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an AsymmetricSignRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricSignRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricSignRequest; - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + /** + * Verifies an AsymmetricSignRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an AsymmetricSignRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricSignRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricSignRequest; - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an AsymmetricSignRequest message. Also converts values to other types if specified. + * @param message AsymmetricSignRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.AsymmetricSignRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { + /** + * Converts this AsymmetricSignRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** TestIamPermissionsRequest resource */ - resource?: (string|null); + /** Properties of an AsymmetricDecryptRequest. */ + interface IAsymmetricDecryptRequest { - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } + /** AsymmetricDecryptRequest name */ + name?: (string|null); - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + /** AsymmetricDecryptRequest ciphertext */ + ciphertext?: (Uint8Array|string|null); + } - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + /** Represents an AsymmetricDecryptRequest. */ + class AsymmetricDecryptRequest implements IAsymmetricDecryptRequest { - /** TestIamPermissionsRequest resource. */ - public resource: string; + /** + * Constructs a new AsymmetricDecryptRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IAsymmetricDecryptRequest); - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; + /** AsymmetricDecryptRequest name. */ + public name: string; - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + /** AsymmetricDecryptRequest ciphertext. */ + public ciphertext: (Uint8Array|string); - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new AsymmetricDecryptRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricDecryptRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IAsymmetricDecryptRequest): google.cloud.kms.v1.AsymmetricDecryptRequest; - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AsymmetricDecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. + * @param message AsymmetricDecryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IAsymmetricDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + /** + * Encodes the specified AsymmetricDecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. + * @param message AsymmetricDecryptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricDecryptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + /** + * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricDecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricDecryptRequest; - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricDecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricDecryptRequest; - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + /** + * Verifies an AsymmetricDecryptRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an AsymmetricDecryptRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricDecryptRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricDecryptRequest; - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an AsymmetricDecryptRequest message. Also converts values to other types if specified. + * @param message AsymmetricDecryptRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.AsymmetricDecryptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { + /** + * Converts this AsymmetricDecryptRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } + /** Properties of a DecryptResponse. */ + interface IDecryptResponse { - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + /** DecryptResponse plaintext */ + plaintext?: (Uint8Array|string|null); + } - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + /** Represents a DecryptResponse. */ + class DecryptResponse implements IDecryptResponse { - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; + /** + * Constructs a new DecryptResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IDecryptResponse); - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + /** DecryptResponse plaintext. */ + public plaintext: (Uint8Array|string); - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new DecryptResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DecryptResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IDecryptResponse): google.cloud.kms.v1.DecryptResponse; - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. + * @param message DecryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + /** + * Encodes the specified DecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. + * @param message DecryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + /** + * Decodes a DecryptResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DecryptResponse; - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a DecryptResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DecryptResponse; - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + /** + * Verifies a DecryptResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a DecryptResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecryptResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DecryptResponse; - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a DecryptResponse message. Also converts values to other types if specified. + * @param message DecryptResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.DecryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a Policy. */ - interface IPolicy { + /** + * Converts this DecryptResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Policy version */ - version?: (number|null); + /** Properties of an EncryptResponse. */ + interface IEncryptResponse { - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); + /** EncryptResponse name */ + name?: (string|null); - /** Policy etag */ - etag?: (Uint8Array|string|null); - } + /** EncryptResponse ciphertext */ + ciphertext?: (Uint8Array|string|null); + } - /** Represents a Policy. */ - class Policy implements IPolicy { + /** Represents an EncryptResponse. */ + class EncryptResponse implements IEncryptResponse { - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); + /** + * Constructs a new EncryptResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IEncryptResponse); - /** Policy version. */ - public version: number; + /** EncryptResponse name. */ + public name: string; - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; + /** EncryptResponse ciphertext. */ + public ciphertext: (Uint8Array|string); - /** Policy etag. */ - public etag: (Uint8Array|string); + /** + * Creates a new EncryptResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IEncryptResponse): google.cloud.kms.v1.EncryptResponse; - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + /** + * Encodes the specified EncryptResponse message. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. + * @param message EncryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IEncryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified EncryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. + * @param message EncryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IEncryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an EncryptResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.EncryptResponse; - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + /** + * Decodes an EncryptResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.EncryptResponse; - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + /** + * Verifies an EncryptResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates an EncryptResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.EncryptResponse; + + /** + * Creates a plain object from an EncryptResponse message. Also converts values to other types if specified. + * @param message EncryptResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.EncryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + /** + * Converts this EncryptResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an AsymmetricSignResponse. */ + interface IAsymmetricSignResponse { - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** AsymmetricSignResponse signature */ + signature?: (Uint8Array|string|null); + } - /** Properties of a Binding. */ - interface IBinding { + /** Represents an AsymmetricSignResponse. */ + class AsymmetricSignResponse implements IAsymmetricSignResponse { - /** Binding role */ - role?: (string|null); + /** + * Constructs a new AsymmetricSignResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IAsymmetricSignResponse); - /** Binding members */ - members?: (string[]|null); + /** AsymmetricSignResponse signature. */ + public signature: (Uint8Array|string); - /** Binding condition */ - condition?: (google.type.IExpr|null); - } + /** + * Creates a new AsymmetricSignResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricSignResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IAsymmetricSignResponse): google.cloud.kms.v1.AsymmetricSignResponse; - /** Represents a Binding. */ - class Binding implements IBinding { + /** + * Encodes the specified AsymmetricSignResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. + * @param message AsymmetricSignResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IAsymmetricSignResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); + /** + * Encodes the specified AsymmetricSignResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. + * @param message AsymmetricSignResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricSignResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Binding role. */ - public role: string; + /** + * Decodes an AsymmetricSignResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricSignResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricSignResponse; - /** Binding members. */ - public members: string[]; + /** + * Decodes an AsymmetricSignResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricSignResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricSignResponse; - /** Binding condition. */ - public condition?: (google.type.IExpr|null); + /** + * Verifies an AsymmetricSignResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + /** + * Creates an AsymmetricSignResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricSignResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricSignResponse; - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an AsymmetricSignResponse message. Also converts values to other types if specified. + * @param message AsymmetricSignResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.AsymmetricSignResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this AsymmetricSignResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + /** Properties of an AsymmetricDecryptResponse. */ + interface IAsymmetricDecryptResponse { - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + /** AsymmetricDecryptResponse plaintext */ + plaintext?: (Uint8Array|string|null); + } - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents an AsymmetricDecryptResponse. */ + class AsymmetricDecryptResponse implements IAsymmetricDecryptResponse { - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + /** + * Constructs a new AsymmetricDecryptResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IAsymmetricDecryptResponse); - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** AsymmetricDecryptResponse plaintext. */ + public plaintext: (Uint8Array|string); - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new AsymmetricDecryptResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsymmetricDecryptResponse instance + */ + public static create(properties?: google.cloud.kms.v1.IAsymmetricDecryptResponse): google.cloud.kms.v1.AsymmetricDecryptResponse; - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { + /** + * Encodes the specified AsymmetricDecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. + * @param message AsymmetricDecryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IAsymmetricDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + /** + * Encodes the specified AsymmetricDecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. + * @param message AsymmetricDecryptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IAsymmetricDecryptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } + /** + * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsymmetricDecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.AsymmetricDecryptResponse; - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { + /** + * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsymmetricDecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.AsymmetricDecryptResponse; - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); + /** + * Verifies an AsymmetricDecryptResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; + /** + * Creates an AsymmetricDecryptResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsymmetricDecryptResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.AsymmetricDecryptResponse; - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + /** + * Creates a plain object from an AsymmetricDecryptResponse message. Also converts values to other types if specified. + * @param message AsymmetricDecryptResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.AsymmetricDecryptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + /** + * Converts this AsymmetricDecryptResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an UpdateCryptoKeyPrimaryVersionRequest. */ + interface IUpdateCryptoKeyPrimaryVersionRequest { - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** UpdateCryptoKeyPrimaryVersionRequest name */ + name?: (string|null); - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + /** UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId */ + cryptoKeyVersionId?: (string|null); + } - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + /** Represents an UpdateCryptoKeyPrimaryVersionRequest. */ + class UpdateCryptoKeyPrimaryVersionRequest implements IUpdateCryptoKeyPrimaryVersionRequest { - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new UpdateCryptoKeyPrimaryVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest); - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + /** UpdateCryptoKeyPrimaryVersionRequest name. */ + public name: string; - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId. */ + public cryptoKeyVersionId: string; - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new UpdateCryptoKeyPrimaryVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCryptoKeyPrimaryVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; - /** Properties of a BindingDelta. */ - interface IBindingDelta { + /** + * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. + * @param message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + /** + * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. + * @param message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BindingDelta role */ - role?: (string|null); + /** + * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCryptoKeyPrimaryVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; - /** BindingDelta member */ - member?: (string|null); + /** + * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCryptoKeyPrimaryVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } + /** + * Verifies an UpdateCryptoKeyPrimaryVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { + /** + * Creates an UpdateCryptoKeyPrimaryVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCryptoKeyPrimaryVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); + /** + * Creates a plain object from an UpdateCryptoKeyPrimaryVersionRequest message. Also converts values to other types if specified. + * @param message UpdateCryptoKeyPrimaryVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + /** + * Converts this UpdateCryptoKeyPrimaryVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BindingDelta role. */ - public role: string; + /** Properties of a DestroyCryptoKeyVersionRequest. */ + interface IDestroyCryptoKeyVersionRequest { - /** BindingDelta member. */ - public member: string; + /** DestroyCryptoKeyVersionRequest name */ + name?: (string|null); + } - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); + /** Represents a DestroyCryptoKeyVersionRequest. */ + class DestroyCryptoKeyVersionRequest implements IDestroyCryptoKeyVersionRequest { - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + /** + * Constructs a new DestroyCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest); - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** DestroyCryptoKeyVersionRequest name. */ + public name: string; - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new DestroyCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DestroyCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + /** + * Encodes the specified DestroyCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. + * @param message DestroyCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestroyCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. + * @param message DestroyCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + /** + * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestroyCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestroyCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + /** + * Verifies a DestroyCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a DestroyCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestroyCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a DestroyCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message DestroyCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.DestroyCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace BindingDelta { + /** + * Converts this DestroyCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 + /** Properties of a RestoreCryptoKeyVersionRequest. */ + interface IRestoreCryptoKeyVersionRequest { + + /** RestoreCryptoKeyVersionRequest name */ + name?: (string|null); } - } - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { + /** Represents a RestoreCryptoKeyVersionRequest. */ + class RestoreCryptoKeyVersionRequest implements IRestoreCryptoKeyVersionRequest { - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + /** + * Constructs a new RestoreCryptoKeyVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest); - /** AuditConfigDelta service */ - service?: (string|null); + /** RestoreCryptoKeyVersionRequest name. */ + public name: string; - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); + /** + * Creates a new RestoreCryptoKeyVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreCryptoKeyVersionRequest instance + */ + public static create(properties?: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; - /** AuditConfigDelta logType */ - logType?: (string|null); - } + /** + * Encodes the specified RestoreCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. + * @param message RestoreCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { + /** + * Encodes the specified RestoreCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. + * @param message RestoreCryptoKeyVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); + /** + * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + /** + * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; - /** AuditConfigDelta service. */ - public service: string; + /** + * Verifies a RestoreCryptoKeyVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; + /** + * Creates a RestoreCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreCryptoKeyVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; - /** AuditConfigDelta logType. */ - public logType: string; + /** + * Creates a plain object from a RestoreCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @param message RestoreCryptoKeyVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.RestoreCryptoKeyVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + /** + * Converts this RestoreCryptoKeyVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a Digest. */ + interface IDigest { - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + /** Digest sha256 */ + sha256?: (Uint8Array|string|null); - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + /** Digest sha384 */ + sha384?: (Uint8Array|string|null); - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + /** Digest sha512 */ + sha512?: (Uint8Array|string|null); + } - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a Digest. */ + class Digest implements IDigest { - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + /** + * Constructs a new Digest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IDigest); + + /** Digest sha256. */ + public sha256: (Uint8Array|string); + + /** Digest sha384. */ + public sha384: (Uint8Array|string); - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Digest sha512. */ + public sha512: (Uint8Array|string); - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Digest digest. */ + public digest?: ("sha256"|"sha384"|"sha512"); - namespace AuditConfigDelta { + /** + * Creates a new Digest instance using the specified properties. + * @param [properties] Properties to set + * @returns Digest instance + */ + public static create(properties?: google.cloud.kms.v1.IDigest): google.cloud.kms.v1.Digest; - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } + /** + * Encodes the specified Digest message. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. + * @param message Digest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IDigest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Namespace type. */ - namespace type { + /** + * Encodes the specified Digest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. + * @param message Digest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IDigest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an Expr. */ - interface IExpr { + /** + * Decodes a Digest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Digest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.Digest; - /** Expr expression */ - expression?: (string|null); + /** + * Decodes a Digest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Digest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.Digest; - /** Expr title */ - title?: (string|null); + /** + * Verifies a Digest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Expr description */ - description?: (string|null); + /** + * Creates a Digest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Digest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.Digest; - /** Expr location */ - location?: (string|null); - } + /** + * Creates a plain object from a Digest message. Also converts values to other types if specified. + * @param message Digest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.Digest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an Expr. */ - class Expr implements IExpr { + /** + * Converts this Digest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { - /** Expr expression. */ - public expression: string; + /** LocationMetadata hsmAvailable */ + hsmAvailable?: (boolean|null); + } - /** Expr title. */ - public title: string; + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { - /** Expr description. */ - public description: string; + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.ILocationMetadata); - /** Expr location. */ - public location: string; + /** LocationMetadata hsmAvailable. */ + public hsmAvailable: boolean; - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.kms.v1.ILocationMetadata): google.cloud.kms.v1.LocationMetadata; - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.LocationMetadata; - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.LocationMetadata; - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.LocationMetadata; - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } } } diff --git a/packages/google-cloud-kms/protos/protos.js b/packages/google-cloud-kms/protos/protos.js index 2842299a5cc..873b6326139 100644 --- a/packages/google-cloud-kms/protos/protos.js +++ b/packages/google-cloud-kms/protos/protos.js @@ -39,2381 +39,2657 @@ */ var google = {}; - google.cloud = (function() { + google.iam = (function() { /** - * Namespace cloud. + * Namespace iam. * @memberof google * @namespace */ - var cloud = {}; + var iam = {}; - cloud.kms = (function() { + iam.v1 = (function() { /** - * Namespace kms. - * @memberof google.cloud + * Namespace v1. + * @memberof google.iam * @namespace */ - var kms = {}; + var v1 = {}; - kms.v1 = (function() { + v1.Policy = (function() { /** - * Namespace v1. - * @memberof google.cloud.kms - * @namespace + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag */ - var v1 = {}; - - v1.KeyManagementService = (function() { - - /** - * Constructs a new KeyManagementService service. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a KeyManagementService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function KeyManagementService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (KeyManagementService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = KeyManagementService; + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates new KeyManagementService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.kms.v1.KeyManagementService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {KeyManagementService} RPC service. Useful where requests and/or responses are streamed. - */ - KeyManagementService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listKeyRings}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef ListKeyRingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ListKeyRingsResponse} [response] ListKeyRingsResponse - */ + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; - /** - * Calls ListKeyRings. - * @function listKeyRings - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListKeyRingsRequest} request ListKeyRingsRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.ListKeyRingsCallback} callback Node-style callback called with the error, if any, and ListKeyRingsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.listKeyRings = function listKeyRings(request, callback) { - return this.rpcCall(listKeyRings, $root.google.cloud.kms.v1.ListKeyRingsRequest, $root.google.cloud.kms.v1.ListKeyRingsResponse, request, callback); - }, "name", { value: "ListKeyRings" }); + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); - /** - * Calls ListKeyRings. - * @function listKeyRings - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListKeyRingsRequest} request ListKeyRingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeys}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef ListCryptoKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ListCryptoKeysResponse} [response] ListCryptoKeysResponse - */ + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Calls ListCryptoKeys. - * @function listCryptoKeys - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListCryptoKeysRequest} request ListCryptoKeysRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.ListCryptoKeysCallback} callback Node-style callback called with the error, if any, and ListCryptoKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.listCryptoKeys = function listCryptoKeys(request, callback) { - return this.rpcCall(listCryptoKeys, $root.google.cloud.kms.v1.ListCryptoKeysRequest, $root.google.cloud.kms.v1.ListCryptoKeysResponse, request, callback); - }, "name", { value: "ListCryptoKeys" }); + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls ListCryptoKeys. - * @function listCryptoKeys - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListCryptoKeysRequest} request ListCryptoKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 4: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + case 3: + message.etag = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeyVersions}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef ListCryptoKeyVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} [response] ListCryptoKeyVersionsResponse - */ + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls ListCryptoKeyVersions. - * @function listCryptoKeyVersions - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} request ListCryptoKeyVersionsRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersionsCallback} callback Node-style callback called with the error, if any, and ListCryptoKeyVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.listCryptoKeyVersions = function listCryptoKeyVersions(request, callback) { - return this.rpcCall(listCryptoKeyVersions, $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest, $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse, request, callback); - }, "name", { value: "ListCryptoKeyVersions" }); + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; - /** - * Calls ListCryptoKeyVersions. - * @function listCryptoKeyVersions - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} request ListCryptoKeyVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listImportJobs}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef ListImportJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ListImportJobsResponse} [response] ListImportJobsResponse - */ + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; - /** - * Calls ListImportJobs. - * @function listImportJobs - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListImportJobsRequest} request ListImportJobsRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.ListImportJobsCallback} callback Node-style callback called with the error, if any, and ListImportJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.listImportJobs = function listImportJobs(request, callback) { - return this.rpcCall(listImportJobs, $root.google.cloud.kms.v1.ListImportJobsRequest, $root.google.cloud.kms.v1.ListImportJobsResponse, request, callback); - }, "name", { value: "ListImportJobs" }); + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls ListImportJobs. - * @function listImportJobs - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IListImportJobsRequest} request ListImportJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return Policy; + })(); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getKeyRing}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef GetKeyRingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.KeyRing} [response] KeyRing - */ + v1.Binding = (function() { - /** - * Calls GetKeyRing. - * @function getKeyRing - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetKeyRingRequest} request GetKeyRingRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.GetKeyRingCallback} callback Node-style callback called with the error, if any, and KeyRing - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.getKeyRing = function getKeyRing(request, callback) { - return this.rpcCall(getKeyRing, $root.google.cloud.kms.v1.GetKeyRingRequest, $root.google.cloud.kms.v1.KeyRing, request, callback); - }, "name", { value: "GetKeyRing" }); + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ - /** - * Calls GetKeyRing. - * @function getKeyRing - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetKeyRingRequest} request GetKeyRingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKey}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef GetCryptoKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey - */ + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; - /** - * Calls GetCryptoKey. - * @function getCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} request GetCryptoKeyRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.GetCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.getCryptoKey = function getCryptoKey(request, callback) { - return this.rpcCall(getCryptoKey, $root.google.cloud.kms.v1.GetCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); - }, "name", { value: "GetCryptoKey" }); + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; - /** - * Calls GetCryptoKey. - * @function getCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} request GetCryptoKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef GetCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ - - /** - * Calls GetCryptoKeyVersion. - * @function getCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} request GetCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.getCryptoKeyVersion = function getCryptoKeyVersion(request, callback) { - return this.rpcCall(getCryptoKeyVersion, $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "GetCryptoKeyVersion" }); + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; - /** - * Calls GetCryptoKeyVersion. - * @function getCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} request GetCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getPublicKey}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef GetPublicKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.PublicKey} [response] PublicKey - */ + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Calls GetPublicKey. - * @function getPublicKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetPublicKeyRequest} request GetPublicKeyRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.GetPublicKeyCallback} callback Node-style callback called with the error, if any, and PublicKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.getPublicKey = function getPublicKey(request, callback) { - return this.rpcCall(getPublicKey, $root.google.cloud.kms.v1.GetPublicKeyRequest, $root.google.cloud.kms.v1.PublicKey, request, callback); - }, "name", { value: "GetPublicKey" }); + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls GetPublicKey. - * @function getPublicKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetPublicKeyRequest} request GetPublicKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getImportJob}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef GetImportJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ImportJob} [response] ImportJob - */ + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls GetImportJob. - * @function getImportJob - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetImportJobRequest} request GetImportJobRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.GetImportJobCallback} callback Node-style callback called with the error, if any, and ImportJob - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.getImportJob = function getImportJob(request, callback) { - return this.rpcCall(getImportJob, $root.google.cloud.kms.v1.GetImportJobRequest, $root.google.cloud.kms.v1.ImportJob, request, callback); - }, "name", { value: "GetImportJob" }); + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; - /** - * Calls GetImportJob. - * @function getImportJob - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IGetImportJobRequest} request GetImportJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createKeyRing}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef CreateKeyRingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.KeyRing} [response] KeyRing - */ - - /** - * Calls CreateKeyRing. - * @function createKeyRing - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateKeyRingRequest} request CreateKeyRingRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.CreateKeyRingCallback} callback Node-style callback called with the error, if any, and KeyRing - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.createKeyRing = function createKeyRing(request, callback) { - return this.rpcCall(createKeyRing, $root.google.cloud.kms.v1.CreateKeyRingRequest, $root.google.cloud.kms.v1.KeyRing, request, callback); - }, "name", { value: "CreateKeyRing" }); - - /** - * Calls CreateKeyRing. - * @function createKeyRing - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateKeyRingRequest} request CreateKeyRingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKey}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef CreateCryptoKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey - */ + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls CreateCryptoKey. - * @function createCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} request CreateCryptoKeyRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.createCryptoKey = function createCryptoKey(request, callback) { - return this.rpcCall(createCryptoKey, $root.google.cloud.kms.v1.CreateCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); - }, "name", { value: "CreateCryptoKey" }); + return Binding; + })(); - /** - * Calls CreateCryptoKey. - * @function createCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} request CreateCryptoKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1.PolicyDelta = (function() { - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef CreateCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ - /** - * Calls CreateCryptoKeyVersion. - * @function createCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} request CreateCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.createCryptoKeyVersion = function createCryptoKeyVersion(request, callback) { - return this.rpcCall(createCryptoKeyVersion, $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "CreateCryptoKeyVersion" }); + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls CreateCryptoKeyVersion. - * @function createCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} request CreateCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#importCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef ImportCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - /** - * Calls ImportCryptoKeyVersion. - * @function importCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} request ImportCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.importCryptoKeyVersion = function importCryptoKeyVersion(request, callback) { - return this.rpcCall(importCryptoKeyVersion, $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "ImportCryptoKeyVersion" }); + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; - /** - * Calls ImportCryptoKeyVersion. - * @function importCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} request ImportCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createImportJob}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef CreateImportJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.ImportJob} [response] ImportJob - */ + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls CreateImportJob. - * @function createImportJob - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateImportJobRequest} request CreateImportJobRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.CreateImportJobCallback} callback Node-style callback called with the error, if any, and ImportJob - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.createImportJob = function createImportJob(request, callback) { - return this.rpcCall(createImportJob, $root.google.cloud.kms.v1.CreateImportJobRequest, $root.google.cloud.kms.v1.ImportJob, request, callback); - }, "name", { value: "CreateImportJob" }); + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls CreateImportJob. - * @function createImportJob - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.ICreateImportJobRequest} request CreateImportJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKey}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef UpdateCryptoKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey - */ + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; - /** - * Calls UpdateCryptoKey. - * @function updateCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} request UpdateCryptoKeyRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.updateCryptoKey = function updateCryptoKey(request, callback) { - return this.rpcCall(updateCryptoKey, $root.google.cloud.kms.v1.UpdateCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); - }, "name", { value: "UpdateCryptoKey" }); + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; - /** - * Calls UpdateCryptoKey. - * @function updateCryptoKey - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} request UpdateCryptoKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef UpdateCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls UpdateCryptoKeyVersion. - * @function updateCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} request UpdateCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.updateCryptoKeyVersion = function updateCryptoKeyVersion(request, callback) { - return this.rpcCall(updateCryptoKeyVersion, $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "UpdateCryptoKeyVersion" }); + return PolicyDelta; + })(); - /** - * Calls UpdateCryptoKeyVersion. - * @function updateCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} request UpdateCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1.BindingDelta = (function() { - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#encrypt}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef EncryptCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.EncryptResponse} [response] EncryptResponse - */ + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ - /** - * Calls Encrypt. - * @function encrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IEncryptRequest} request EncryptRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.EncryptCallback} callback Node-style callback called with the error, if any, and EncryptResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.encrypt = function encrypt(request, callback) { - return this.rpcCall(encrypt, $root.google.cloud.kms.v1.EncryptRequest, $root.google.cloud.kms.v1.EncryptResponse, request, callback); - }, "name", { value: "Encrypt" }); - - /** - * Calls Encrypt. - * @function encrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IEncryptRequest} request EncryptRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#decrypt}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef DecryptCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.DecryptResponse} [response] DecryptResponse - */ + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls Decrypt. - * @function decrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IDecryptRequest} request DecryptRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.DecryptCallback} callback Node-style callback called with the error, if any, and DecryptResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.decrypt = function decrypt(request, callback) { - return this.rpcCall(decrypt, $root.google.cloud.kms.v1.DecryptRequest, $root.google.cloud.kms.v1.DecryptResponse, request, callback); - }, "name", { value: "Decrypt" }); + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; - /** - * Calls Decrypt. - * @function decrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IDecryptRequest} request DecryptRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricSign}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef AsymmetricSignCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.AsymmetricSignResponse} [response] AsymmetricSignResponse - */ + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; - /** - * Calls AsymmetricSign. - * @function asymmetricSign - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IAsymmetricSignRequest} request AsymmetricSignRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.AsymmetricSignCallback} callback Node-style callback called with the error, if any, and AsymmetricSignResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.asymmetricSign = function asymmetricSign(request, callback) { - return this.rpcCall(asymmetricSign, $root.google.cloud.kms.v1.AsymmetricSignRequest, $root.google.cloud.kms.v1.AsymmetricSignResponse, request, callback); - }, "name", { value: "AsymmetricSign" }); + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; - /** - * Calls AsymmetricSign. - * @function asymmetricSign - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IAsymmetricSignRequest} request AsymmetricSignRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricDecrypt}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef AsymmetricDecryptCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.AsymmetricDecryptResponse} [response] AsymmetricDecryptResponse - */ + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && message.hasOwnProperty("member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Calls AsymmetricDecrypt. - * @function asymmetricDecrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} request AsymmetricDecryptRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.AsymmetricDecryptCallback} callback Node-style callback called with the error, if any, and AsymmetricDecryptResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.asymmetricDecrypt = function asymmetricDecrypt(request, callback) { - return this.rpcCall(asymmetricDecrypt, $root.google.cloud.kms.v1.AsymmetricDecryptRequest, $root.google.cloud.kms.v1.AsymmetricDecryptResponse, request, callback); - }, "name", { value: "AsymmetricDecrypt" }); + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls AsymmetricDecrypt. - * @function asymmetricDecrypt - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} request AsymmetricDecryptRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + case 4: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyPrimaryVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef UpdateCryptoKeyPrimaryVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey - */ + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls UpdateCryptoKeyPrimaryVersion. - * @function updateCryptoKeyPrimaryVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} request UpdateCryptoKeyPrimaryVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersionCallback} callback Node-style callback called with the error, if any, and CryptoKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.updateCryptoKeyPrimaryVersion = function updateCryptoKeyPrimaryVersion(request, callback) { - return this.rpcCall(updateCryptoKeyPrimaryVersion, $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); - }, "name", { value: "UpdateCryptoKeyPrimaryVersion" }); + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; - /** - * Calls UpdateCryptoKeyPrimaryVersion. - * @function updateCryptoKeyPrimaryVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} request UpdateCryptoKeyPrimaryVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#destroyCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef DestroyCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; - /** - * Calls DestroyCryptoKeyVersion. - * @function destroyCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} request DestroyCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.destroyCryptoKeyVersion = function destroyCryptoKeyVersion(request, callback) { - return this.rpcCall(destroyCryptoKeyVersion, $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "DestroyCryptoKeyVersion" }); + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls DestroyCryptoKeyVersion. - * @function destroyCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} request DestroyCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); - /** - * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#restoreCryptoKeyVersion}. - * @memberof google.cloud.kms.v1.KeyManagementService - * @typedef RestoreCryptoKeyVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion - */ + return BindingDelta; + })(); - /** - * Calls RestoreCryptoKeyVersion. - * @function restoreCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} request RestoreCryptoKeyVersionRequest message or plain object - * @param {google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KeyManagementService.prototype.restoreCryptoKeyVersion = function restoreCryptoKeyVersion(request, callback) { - return this.rpcCall(restoreCryptoKeyVersion, $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); - }, "name", { value: "RestoreCryptoKeyVersion" }); + v1.AuditConfigDelta = (function() { - /** - * Calls RestoreCryptoKeyVersion. - * @function restoreCryptoKeyVersion - * @memberof google.cloud.kms.v1.KeyManagementService - * @instance - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} request RestoreCryptoKeyVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ - return KeyManagementService; - })(); + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - v1.ListKeyRingsRequest = (function() { + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; - /** - * Properties of a ListKeyRingsRequest. - * @memberof google.cloud.kms.v1 - * @interface IListKeyRingsRequest - * @property {string|null} [parent] ListKeyRingsRequest parent - * @property {number|null} [pageSize] ListKeyRingsRequest pageSize - * @property {string|null} [pageToken] ListKeyRingsRequest pageToken - * @property {string|null} [filter] ListKeyRingsRequest filter - * @property {string|null} [orderBy] ListKeyRingsRequest orderBy - */ + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; - /** - * Constructs a new ListKeyRingsRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListKeyRingsRequest. - * @implements IListKeyRingsRequest - * @constructor - * @param {google.cloud.kms.v1.IListKeyRingsRequest=} [properties] Properties to set - */ - function ListKeyRingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListKeyRingsRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - */ - ListKeyRingsRequest.prototype.parent = ""; + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; - /** - * ListKeyRingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - */ - ListKeyRingsRequest.prototype.pageSize = 0; + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; - /** - * ListKeyRingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - */ - ListKeyRingsRequest.prototype.pageToken = ""; + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; - /** - * ListKeyRingsRequest filter. - * @member {string} filter - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - */ - ListKeyRingsRequest.prototype.filter = ""; + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && message.hasOwnProperty("logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; - /** - * ListKeyRingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - */ - ListKeyRingsRequest.prototype.orderBy = ""; + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ListKeyRingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {google.cloud.kms.v1.IListKeyRingsRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest instance - */ - ListKeyRingsRequest.create = function create(properties) { - return new ListKeyRingsRequest(properties); - }; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListKeyRingsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {google.cloud.kms.v1.IListKeyRingsRequest} message ListKeyRingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeyRingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListKeyRingsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {google.cloud.kms.v1.IListKeyRingsRequest} message ListKeyRingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeyRingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; - /** - * Decodes a ListKeyRingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeyRingsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListKeyRingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; - /** - * Decodes a ListKeyRingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeyRingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; - /** - * Verifies a ListKeyRingsRequest message. - * @function verify - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListKeyRingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a ListKeyRingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest - */ - ListKeyRingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListKeyRingsRequest) - return object; - var message = new $root.google.cloud.kms.v1.ListKeyRingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); - /** - * Creates a plain object from a ListKeyRingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @static - * @param {google.cloud.kms.v1.ListKeyRingsRequest} message ListKeyRingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListKeyRingsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + return AuditConfigDelta; + })(); - /** - * Converts this ListKeyRingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListKeyRingsRequest - * @instance - * @returns {Object.} JSON object - */ - ListKeyRingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v1.GetPolicyOptions = (function() { - return ListKeyRingsRequest; - })(); + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ - v1.ListCryptoKeysRequest = (function() { + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a ListCryptoKeysRequest. - * @memberof google.cloud.kms.v1 - * @interface IListCryptoKeysRequest - * @property {string|null} [parent] ListCryptoKeysRequest parent - * @property {number|null} [pageSize] ListCryptoKeysRequest pageSize - * @property {string|null} [pageToken] ListCryptoKeysRequest pageToken - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null} [versionView] ListCryptoKeysRequest versionView - * @property {string|null} [filter] ListCryptoKeysRequest filter - * @property {string|null} [orderBy] ListCryptoKeysRequest orderBy - */ + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; - /** - * Constructs a new ListCryptoKeysRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListCryptoKeysRequest. - * @implements IListCryptoKeysRequest - * @constructor - * @param {google.cloud.kms.v1.IListCryptoKeysRequest=} [properties] Properties to set - */ - function ListCryptoKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCryptoKeysRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.parent = ""; + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; - /** - * ListCryptoKeysRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.pageSize = 0; + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; - /** - * ListCryptoKeysRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.pageToken = ""; + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ListCryptoKeysRequest versionView. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} versionView - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.versionView = 0; + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestedPolicyVersion = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ListCryptoKeysRequest filter. - * @member {string} filter - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.filter = ""; + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ListCryptoKeysRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - */ - ListCryptoKeysRequest.prototype.orderBy = ""; + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; - /** - * Creates a new ListCryptoKeysRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeysRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest instance - */ - ListCryptoKeysRequest.create = function create(properties) { - return new ListCryptoKeysRequest(properties); - }; + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; - /** - * Encodes the specified ListCryptoKeysRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeysRequest} message ListCryptoKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.versionView != null && message.hasOwnProperty("versionView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.versionView); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - return writer; - }; + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; - /** - * Encodes the specified ListCryptoKeysRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeysRequest} message ListCryptoKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a ListCryptoKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.versionView = reader.int32(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.orderBy = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return GetPolicyOptions; + })(); - /** - * Decodes a ListCryptoKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v1.IAMPolicy = (function() { - /** - * Verifies a ListCryptoKeysRequest message. - * @function verify - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCryptoKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.versionView != null && message.hasOwnProperty("versionView")) - switch (message.versionView) { - default: - return "versionView: enum value expected"; - case 0: - case 1: - break; - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Creates a ListCryptoKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest - */ - ListCryptoKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeysRequest) - return object; - var message = new $root.google.cloud.kms.v1.ListCryptoKeysRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - switch (object.versionView) { - case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": - case 0: - message.versionView = 0; - break; - case "FULL": - case 1: - message.versionView = 1; - break; - } - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - /** - * Creates a plain object from a ListCryptoKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @static - * @param {google.cloud.kms.v1.ListCryptoKeysRequest} message ListCryptoKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCryptoKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.versionView = options.enums === String ? "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED" : 0; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.versionView != null && message.hasOwnProperty("versionView")) - object.versionView = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.versionView] : message.versionView; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Converts this ListCryptoKeysRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListCryptoKeysRequest - * @instance - * @returns {Object.} JSON object - */ - ListCryptoKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ - return ListCryptoKeysRequest; - })(); + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); - v1.ListCryptoKeyVersionsRequest = (function() { + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a ListCryptoKeyVersionsRequest. - * @memberof google.cloud.kms.v1 - * @interface IListCryptoKeyVersionsRequest - * @property {string|null} [parent] ListCryptoKeyVersionsRequest parent - * @property {number|null} [pageSize] ListCryptoKeyVersionsRequest pageSize - * @property {string|null} [pageToken] ListCryptoKeyVersionsRequest pageToken - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null} [view] ListCryptoKeyVersionsRequest view - * @property {string|null} [filter] ListCryptoKeyVersionsRequest filter - * @property {string|null} [orderBy] ListCryptoKeyVersionsRequest orderBy - */ + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ - /** - * Constructs a new ListCryptoKeyVersionsRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListCryptoKeyVersionsRequest. - * @implements IListCryptoKeyVersionsRequest - * @constructor - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest=} [properties] Properties to set - */ - function ListCryptoKeyVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); - /** - * ListCryptoKeyVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.parent = ""; + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * ListCryptoKeyVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.pageSize = 0; + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ - /** - * ListCryptoKeyVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.pageToken = ""; + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); - /** - * ListCryptoKeyVersionsRequest view. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} view - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.view = 0; + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * ListCryptoKeyVersionsRequest filter. - * @member {string} filter - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.filter = ""; + return IAMPolicy; + })(); - /** - * ListCryptoKeyVersionsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - */ - ListCryptoKeyVersionsRequest.prototype.orderBy = ""; + v1.SetIamPolicyRequest = (function() { - /** - * Creates a new ListCryptoKeyVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest instance - */ - ListCryptoKeyVersionsRequest.create = function create(properties) { - return new ListCryptoKeyVersionsRequest(properties); - }; + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + */ - /** - * Encodes the specified ListCryptoKeyVersionsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeyVersionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - return writer; - }; + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ListCryptoKeyVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeyVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; - /** - * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeyVersionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.view = reader.int32(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.orderBy = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; - /** - * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeyVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; - /** - * Verifies a ListCryptoKeyVersionsRequest message. - * @function verify - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCryptoKeyVersionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - break; - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a ListCryptoKeyVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest - */ - ListCryptoKeyVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest) - return object; - var message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - switch (object.view) { - case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "FULL": + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.view = 1; + message.resource = reader.string(); + break; + case 2: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCryptoKeyVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @static - * @param {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCryptoKeyVersionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.view = options.enums === String ? "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED" : 0; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.view] : message.view; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCryptoKeyVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCryptoKeyVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return ListCryptoKeyVersionsRequest; - })(); + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - v1.ListImportJobsRequest = (function() { + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; - /** - * Properties of a ListImportJobsRequest. - * @memberof google.cloud.kms.v1 - * @interface IListImportJobsRequest - * @property {string|null} [parent] ListImportJobsRequest parent - * @property {number|null} [pageSize] ListImportJobsRequest pageSize - * @property {string|null} [pageToken] ListImportJobsRequest pageToken - * @property {string|null} [filter] ListImportJobsRequest filter - * @property {string|null} [orderBy] ListImportJobsRequest orderBy - */ + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; - /** - * Constructs a new ListImportJobsRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListImportJobsRequest. - * @implements IListImportJobsRequest - * @constructor - * @param {google.cloud.kms.v1.IListImportJobsRequest=} [properties] Properties to set - */ - function ListImportJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; - /** - * ListImportJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - */ - ListImportJobsRequest.prototype.parent = ""; + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ListImportJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - */ - ListImportJobsRequest.prototype.pageSize = 0; + return SetIamPolicyRequest; + })(); - /** - * ListImportJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - */ - ListImportJobsRequest.prototype.pageToken = ""; + v1.GetIamPolicyRequest = (function() { - /** - * ListImportJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - */ - ListImportJobsRequest.prototype.filter = ""; + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ - /** - * ListImportJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - */ - ListImportJobsRequest.prototype.orderBy = ""; + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new ListImportJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {google.cloud.kms.v1.IListImportJobsRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest instance - */ - ListImportJobsRequest.create = function create(properties) { - return new ListImportJobsRequest(properties); - }; + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; - /** - * Encodes the specified ListImportJobsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {google.cloud.kms.v1.IListImportJobsRequest} message ListImportJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListImportJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; - /** - * Encodes the specified ListImportJobsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {google.cloud.kms.v1.IListImportJobsRequest} message ListImportJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListImportJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; - /** - * Decodes a ListImportJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListImportJobsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListImportJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes a ListImportJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListImportJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a ListImportJobsRequest message. - * @function verify - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListImportJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a ListImportJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest - */ - ListImportJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListImportJobsRequest) - return object; - var message = new $root.google.cloud.kms.v1.ListImportJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a ListImportJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @static - * @param {google.cloud.kms.v1.ListImportJobsRequest} message ListImportJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListImportJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) return object; - }; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; - /** - * Converts this ListImportJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListImportJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListImportJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; - return ListImportJobsRequest; - })(); + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.ListKeyRingsResponse = (function() { + return GetIamPolicyRequest; + })(); - /** - * Properties of a ListKeyRingsResponse. - * @memberof google.cloud.kms.v1 - * @interface IListKeyRingsResponse - * @property {Array.|null} [keyRings] ListKeyRingsResponse keyRings - * @property {string|null} [nextPageToken] ListKeyRingsResponse nextPageToken - * @property {number|null} [totalSize] ListKeyRingsResponse totalSize - */ + v1.TestIamPermissionsRequest = (function() { - /** - * Constructs a new ListKeyRingsResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListKeyRingsResponse. - * @implements IListKeyRingsResponse - * @constructor - * @param {google.cloud.kms.v1.IListKeyRingsResponse=} [properties] Properties to set - */ - function ListKeyRingsResponse(properties) { - this.keyRings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ - /** - * ListKeyRingsResponse keyRings. - * @member {Array.} keyRings - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @instance - */ - ListKeyRingsResponse.prototype.keyRings = $util.emptyArray; + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListKeyRingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @instance - */ - ListKeyRingsResponse.prototype.nextPageToken = ""; + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; - /** - * ListKeyRingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @instance - */ - ListKeyRingsResponse.prototype.totalSize = 0; + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - /** - * Creates a new ListKeyRingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {google.cloud.kms.v1.IListKeyRingsResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse instance - */ - ListKeyRingsResponse.create = function create(properties) { - return new ListKeyRingsResponse(properties); - }; + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; - /** - * Encodes the specified ListKeyRingsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {google.cloud.kms.v1.IListKeyRingsResponse} message ListKeyRingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeyRingsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyRings != null && message.keyRings.length) - for (var i = 0; i < message.keyRings.length; ++i) - $root.google.cloud.kms.v1.KeyRing.encode(message.keyRings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; - /** - * Encodes the specified ListKeyRingsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {google.cloud.kms.v1.IListKeyRingsResponse} message ListKeyRingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeyRingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListKeyRingsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeyRingsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListKeyRingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keyRings && message.keyRings.length)) - message.keyRings = []; - message.keyRings.push($root.google.cloud.kms.v1.KeyRing.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ListKeyRingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeyRingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListKeyRingsResponse message. - * @function verify - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListKeyRingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyRings != null && message.hasOwnProperty("keyRings")) { - if (!Array.isArray(message.keyRings)) - return "keyRings: array expected"; - for (var i = 0; i < message.keyRings.length; ++i) { - var error = $root.google.cloud.kms.v1.KeyRing.verify(message.keyRings[i]); - if (error) - return "keyRings." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - return null; - }; + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; - /** - * Creates a ListKeyRingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse - */ - ListKeyRingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListKeyRingsResponse) - return object; - var message = new $root.google.cloud.kms.v1.ListKeyRingsResponse(); - if (object.keyRings) { - if (!Array.isArray(object.keyRings)) - throw TypeError(".google.cloud.kms.v1.ListKeyRingsResponse.keyRings: array expected"); - message.keyRings = []; - for (var i = 0; i < object.keyRings.length; ++i) { - if (typeof object.keyRings[i] !== "object") - throw TypeError(".google.cloud.kms.v1.ListKeyRingsResponse.keyRings: object expected"); - message.keyRings[i] = $root.google.cloud.kms.v1.KeyRing.fromObject(object.keyRings[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; - /** - * Creates a plain object from a ListKeyRingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @static - * @param {google.cloud.kms.v1.ListKeyRingsResponse} message ListKeyRingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListKeyRingsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keyRings = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.keyRings && message.keyRings.length) { - object.keyRings = []; - for (var j = 0; j < message.keyRings.length; ++j) - object.keyRings[j] = $root.google.cloud.kms.v1.KeyRing.toObject(message.keyRings[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; - /** - * Converts this ListKeyRingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListKeyRingsResponse - * @instance - * @returns {Object.} JSON object - */ - ListKeyRingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ListKeyRingsResponse; - })(); + return TestIamPermissionsRequest; + })(); - v1.ListCryptoKeysResponse = (function() { + v1.TestIamPermissionsResponse = (function() { - /** - * Properties of a ListCryptoKeysResponse. - * @memberof google.cloud.kms.v1 - * @interface IListCryptoKeysResponse - * @property {Array.|null} [cryptoKeys] ListCryptoKeysResponse cryptoKeys - * @property {string|null} [nextPageToken] ListCryptoKeysResponse nextPageToken - * @property {number|null} [totalSize] ListCryptoKeysResponse totalSize - */ + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ - /** - * Constructs a new ListCryptoKeysResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListCryptoKeysResponse. - * @implements IListCryptoKeysResponse - * @constructor - * @param {google.cloud.kms.v1.IListCryptoKeysResponse=} [properties] Properties to set - */ - function ListCryptoKeysResponse(properties) { - this.cryptoKeys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListCryptoKeysResponse cryptoKeys. - * @member {Array.} cryptoKeys - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse - * @instance - */ - ListCryptoKeysResponse.prototype.cryptoKeys = $util.emptyArray; + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - /** - * ListCryptoKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse - * @instance - */ - ListCryptoKeysResponse.prototype.nextPageToken = ""; + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; - /** - * ListCryptoKeysResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse - * @instance - */ - ListCryptoKeysResponse.prototype.totalSize = 0; + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; - /** - * Creates a new ListCryptoKeysResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse - * @static - * @param {google.cloud.kms.v1.IListCryptoKeysResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse instance - */ - ListCryptoKeysResponse.create = function create(properties) { - return new ListCryptoKeysResponse(properties); - }; + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ListCryptoKeysResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse - * @static - * @param {google.cloud.kms.v1.IListCryptoKeysResponse} message ListCryptoKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cryptoKeys != null && message.cryptoKeys.length) - for (var i = 0; i < message.cryptoKeys.length; ++i) - $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListCryptoKeysResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsResponse; + })(); + + v1.logging = (function() { + + /** + * Namespace logging. + * @memberof google.iam.v1 + * @namespace + */ + var logging = {}; + + logging.AuditData = (function() { + + /** + * Properties of an AuditData. + * @memberof google.iam.v1.logging + * @interface IAuditData + * @property {google.iam.v1.IPolicyDelta|null} [policyDelta] AuditData policyDelta + */ + + /** + * Constructs a new AuditData. + * @memberof google.iam.v1.logging + * @classdesc Represents an AuditData. + * @implements IAuditData + * @constructor + * @param {google.iam.v1.logging.IAuditData=} [properties] Properties to set + */ + function AuditData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditData policyDelta. + * @member {google.iam.v1.IPolicyDelta|null|undefined} policyDelta + * @memberof google.iam.v1.logging.AuditData + * @instance + */ + AuditData.prototype.policyDelta = null; + + /** + * Creates a new AuditData instance using the specified properties. + * @function create + * @memberof google.iam.v1.logging.AuditData + * @static + * @param {google.iam.v1.logging.IAuditData=} [properties] Properties to set + * @returns {google.iam.v1.logging.AuditData} AuditData instance + */ + AuditData.create = function create(properties) { + return new AuditData(properties); + }; + + /** + * Encodes the specified AuditData message. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.logging.AuditData + * @static + * @param {google.iam.v1.logging.IAuditData} message AuditData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyDelta != null && message.hasOwnProperty("policyDelta")) + $root.google.iam.v1.PolicyDelta.encode(message.policyDelta, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditData message, length delimited. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static - * @param {google.cloud.kms.v1.IListCryptoKeysResponse} message ListCryptoKeysResponse message or plain object to encode + * @param {google.iam.v1.logging.IAuditData} message AuditData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCryptoKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + AuditData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCryptoKeysResponse message from the specified reader or buffer. + * Decodes an AuditData message from the specified reader or buffer. * @function decode - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + * @returns {google.iam.v1.logging.AuditData} AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCryptoKeysResponse.decode = function decode(reader, length) { + AuditData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeysResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.logging.AuditData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.cryptoKeys && message.cryptoKeys.length)) - message.cryptoKeys = []; - message.cryptoKeys.push($root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32())); - break; case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); + message.policyDelta = $root.google.iam.v1.PolicyDelta.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2424,9071 +2700,8294 @@ }; /** - * Decodes a ListCryptoKeysResponse message from the specified reader or buffer, length delimited. + * Decodes an AuditData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + * @returns {google.iam.v1.logging.AuditData} AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCryptoKeysResponse.decodeDelimited = function decodeDelimited(reader) { + AuditData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCryptoKeysResponse message. + * Verifies an AuditData message. * @function verify - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCryptoKeysResponse.verify = function verify(message) { + AuditData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cryptoKeys != null && message.hasOwnProperty("cryptoKeys")) { - if (!Array.isArray(message.cryptoKeys)) - return "cryptoKeys: array expected"; - for (var i = 0; i < message.cryptoKeys.length; ++i) { - var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKeys[i]); - if (error) - return "cryptoKeys." + error; - } + if (message.policyDelta != null && message.hasOwnProperty("policyDelta")) { + var error = $root.google.iam.v1.PolicyDelta.verify(message.policyDelta); + if (error) + return "policyDelta." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListCryptoKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AuditData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + * @returns {google.iam.v1.logging.AuditData} AuditData */ - ListCryptoKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeysResponse) + AuditData.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.logging.AuditData) return object; - var message = new $root.google.cloud.kms.v1.ListCryptoKeysResponse(); - if (object.cryptoKeys) { - if (!Array.isArray(object.cryptoKeys)) - throw TypeError(".google.cloud.kms.v1.ListCryptoKeysResponse.cryptoKeys: array expected"); - message.cryptoKeys = []; - for (var i = 0; i < object.cryptoKeys.length; ++i) { - if (typeof object.cryptoKeys[i] !== "object") - throw TypeError(".google.cloud.kms.v1.ListCryptoKeysResponse.cryptoKeys: object expected"); - message.cryptoKeys[i] = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKeys[i]); - } + var message = new $root.google.iam.v1.logging.AuditData(); + if (object.policyDelta != null) { + if (typeof object.policyDelta !== "object") + throw TypeError(".google.iam.v1.logging.AuditData.policyDelta: object expected"); + message.policyDelta = $root.google.iam.v1.PolicyDelta.fromObject(object.policyDelta); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListCryptoKeysResponse message. Also converts values to other types if specified. + * Creates a plain object from an AuditData message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @static - * @param {google.cloud.kms.v1.ListCryptoKeysResponse} message ListCryptoKeysResponse + * @param {google.iam.v1.logging.AuditData} message AuditData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCryptoKeysResponse.toObject = function toObject(message, options) { + AuditData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.cryptoKeys = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.cryptoKeys && message.cryptoKeys.length) { - object.cryptoKeys = []; - for (var j = 0; j < message.cryptoKeys.length; ++j) - object.cryptoKeys[j] = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKeys[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.policyDelta = null; + if (message.policyDelta != null && message.hasOwnProperty("policyDelta")) + object.policyDelta = $root.google.iam.v1.PolicyDelta.toObject(message.policyDelta, options); return object; }; /** - * Converts this ListCryptoKeysResponse to JSON. + * Converts this AuditData to JSON. * @function toJSON - * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @memberof google.iam.v1.logging.AuditData * @instance * @returns {Object.} JSON object */ - ListCryptoKeysResponse.prototype.toJSON = function toJSON() { + AuditData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListCryptoKeysResponse; + return AuditData; })(); - v1.ListCryptoKeyVersionsResponse = (function() { + return logging; + })(); - /** - * Properties of a ListCryptoKeyVersionsResponse. - * @memberof google.cloud.kms.v1 - * @interface IListCryptoKeyVersionsResponse - * @property {Array.|null} [cryptoKeyVersions] ListCryptoKeyVersionsResponse cryptoKeyVersions - * @property {string|null} [nextPageToken] ListCryptoKeyVersionsResponse nextPageToken - * @property {number|null} [totalSize] ListCryptoKeyVersionsResponse totalSize - */ + return v1; + })(); - /** - * Constructs a new ListCryptoKeyVersionsResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListCryptoKeyVersionsResponse. - * @implements IListCryptoKeyVersionsResponse - * @constructor - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse=} [properties] Properties to set - */ - function ListCryptoKeyVersionsResponse(properties) { - this.cryptoKeyVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return iam; + })(); - /** - * ListCryptoKeyVersionsResponse cryptoKeyVersions. - * @member {Array.} cryptoKeyVersions - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @instance - */ - ListCryptoKeyVersionsResponse.prototype.cryptoKeyVersions = $util.emptyArray; + google.type = (function() { - /** - * ListCryptoKeyVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @instance - */ - ListCryptoKeyVersionsResponse.prototype.nextPageToken = ""; + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; - /** - * ListCryptoKeyVersionsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @instance - */ - ListCryptoKeyVersionsResponse.prototype.totalSize = 0; + type.Expr = (function() { - /** - * Creates a new ListCryptoKeyVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse instance - */ - ListCryptoKeyVersionsResponse.create = function create(properties) { - return new ListCryptoKeyVersionsResponse(properties); - }; + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ - /** - * Encodes the specified ListCryptoKeyVersionsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeyVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cryptoKeyVersions != null && message.cryptoKeyVersions.length) - for (var i = 0; i < message.cryptoKeyVersions.length; ++i) - $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ListCryptoKeyVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCryptoKeyVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; - /** - * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeyVersionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.cryptoKeyVersions && message.cryptoKeyVersions.length)) - message.cryptoKeyVersions = []; - message.cryptoKeyVersions.push($root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; - /** - * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCryptoKeyVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; - /** - * Verifies a ListCryptoKeyVersionsResponse message. - * @function verify - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCryptoKeyVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cryptoKeyVersions != null && message.hasOwnProperty("cryptoKeyVersions")) { - if (!Array.isArray(message.cryptoKeyVersions)) - return "cryptoKeyVersions: array expected"; - for (var i = 0; i < message.cryptoKeyVersions.length; ++i) { - var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersions[i]); - if (error) - return "cryptoKeyVersions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - return null; - }; + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; - /** - * Creates a ListCryptoKeyVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse - */ - ListCryptoKeyVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse) - return object; - var message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse(); - if (object.cryptoKeyVersions) { - if (!Array.isArray(object.cryptoKeyVersions)) - throw TypeError(".google.cloud.kms.v1.ListCryptoKeyVersionsResponse.cryptoKeyVersions: array expected"); - message.cryptoKeyVersions = []; - for (var i = 0; i < object.cryptoKeyVersions.length; ++i) { - if (typeof object.cryptoKeyVersions[i] !== "object") - throw TypeError(".google.cloud.kms.v1.ListCryptoKeyVersionsResponse.cryptoKeyVersions: object expected"); - message.cryptoKeyVersions[i] = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; - /** - * Creates a plain object from a ListCryptoKeyVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @static - * @param {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCryptoKeyVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cryptoKeyVersions = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.cryptoKeyVersions && message.cryptoKeyVersions.length) { - object.cryptoKeyVersions = []; - for (var j = 0; j < message.cryptoKeyVersions.length; ++j) - object.cryptoKeyVersions[j] = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && message.hasOwnProperty("expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; - /** - * Converts this ListCryptoKeyVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCryptoKeyVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return ListCryptoKeyVersionsResponse; - })(); + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - v1.ListImportJobsResponse = (function() { + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a ListImportJobsResponse. - * @memberof google.cloud.kms.v1 - * @interface IListImportJobsResponse - * @property {Array.|null} [importJobs] ListImportJobsResponse importJobs - * @property {string|null} [nextPageToken] ListImportJobsResponse nextPageToken - * @property {number|null} [totalSize] ListImportJobsResponse totalSize - */ + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; - /** - * Constructs a new ListImportJobsResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a ListImportJobsResponse. - * @implements IListImportJobsResponse - * @constructor - * @param {google.cloud.kms.v1.IListImportJobsResponse=} [properties] Properties to set - */ - function ListImportJobsResponse(properties) { - this.importJobs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; - /** - * ListImportJobsResponse importJobs. - * @member {Array.} importJobs - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @instance - */ - ListImportJobsResponse.prototype.importJobs = $util.emptyArray; + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; - /** - * ListImportJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @instance - */ - ListImportJobsResponse.prototype.nextPageToken = ""; + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ListImportJobsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @instance - */ - ListImportJobsResponse.prototype.totalSize = 0; + return Expr; + })(); - /** - * Creates a new ListImportJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {google.cloud.kms.v1.IListImportJobsResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse instance - */ - ListImportJobsResponse.create = function create(properties) { - return new ListImportJobsResponse(properties); - }; + return type; + })(); - /** - * Encodes the specified ListImportJobsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {google.cloud.kms.v1.IListImportJobsResponse} message ListImportJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListImportJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.importJobs != null && message.importJobs.length) - for (var i = 0; i < message.importJobs.length; ++i) - $root.google.cloud.kms.v1.ImportJob.encode(message.importJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - return writer; - }; - - /** - * Encodes the specified ListImportJobsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {google.cloud.kms.v1.IListImportJobsResponse} message ListImportJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListImportJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + google.api = (function() { - /** - * Decodes a ListImportJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListImportJobsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListImportJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.importJobs && message.importJobs.length)) - message.importJobs = []; - message.importJobs.push($root.google.cloud.kms.v1.ImportJob.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; - /** - * Decodes a ListImportJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListImportJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + api.Http = (function() { - /** - * Verifies a ListImportJobsResponse message. - * @function verify - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListImportJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.importJobs != null && message.hasOwnProperty("importJobs")) { - if (!Array.isArray(message.importJobs)) - return "importJobs: array expected"; - for (var i = 0; i < message.importJobs.length; ++i) { - var error = $root.google.cloud.kms.v1.ImportJob.verify(message.importJobs[i]); - if (error) - return "importJobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - return null; - }; + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ - /** - * Creates a ListImportJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse - */ - ListImportJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ListImportJobsResponse) - return object; - var message = new $root.google.cloud.kms.v1.ListImportJobsResponse(); - if (object.importJobs) { - if (!Array.isArray(object.importJobs)) - throw TypeError(".google.cloud.kms.v1.ListImportJobsResponse.importJobs: array expected"); - message.importJobs = []; - for (var i = 0; i < object.importJobs.length; ++i) { - if (typeof object.importJobs[i] !== "object") - throw TypeError(".google.cloud.kms.v1.ListImportJobsResponse.importJobs: object expected"); - message.importJobs[i] = $root.google.cloud.kms.v1.ImportJob.fromObject(object.importJobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a ListImportJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @static - * @param {google.cloud.kms.v1.ListImportJobsResponse} message ListImportJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListImportJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.importJobs = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.importJobs && message.importJobs.length) { - object.importJobs = []; - for (var j = 0; j < message.importJobs.length; ++j) - object.importJobs[j] = $root.google.cloud.kms.v1.ImportJob.toObject(message.importJobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; - /** - * Converts this ListImportJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ListImportJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListImportJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; - return ListImportJobsResponse; - })(); + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; - v1.GetKeyRingRequest = (function() { + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; - /** - * Properties of a GetKeyRingRequest. - * @memberof google.cloud.kms.v1 - * @interface IGetKeyRingRequest - * @property {string|null} [name] GetKeyRingRequest name - */ + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new GetKeyRingRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a GetKeyRingRequest. - * @implements IGetKeyRingRequest - * @constructor - * @param {google.cloud.kms.v1.IGetKeyRingRequest=} [properties] Properties to set - */ - function GetKeyRingRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * GetKeyRingRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @instance - */ - GetKeyRingRequest.prototype.name = ""; + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new GetKeyRingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {google.cloud.kms.v1.IGetKeyRingRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest instance - */ - GetKeyRingRequest.create = function create(properties) { - return new GetKeyRingRequest(properties); - }; + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; - /** - * Encodes the specified GetKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {google.cloud.kms.v1.IGetKeyRingRequest} message GetKeyRingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetKeyRingRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; - /** - * Encodes the specified GetKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {google.cloud.kms.v1.IGetKeyRingRequest} message GetKeyRingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetKeyRingRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; - /** - * Decodes a GetKeyRingRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetKeyRingRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetKeyRingRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a GetKeyRingRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetKeyRingRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Http; + })(); - /** - * Verifies a GetKeyRingRequest message. - * @function verify - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetKeyRingRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetKeyRingRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest - */ - GetKeyRingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.GetKeyRingRequest) - return object; - var message = new $root.google.cloud.kms.v1.GetKeyRingRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + api.HttpRule = (function() { - /** - * Creates a plain object from a GetKeyRingRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @static - * @param {google.cloud.kms.v1.GetKeyRingRequest} message GetKeyRingRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetKeyRingRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ - /** - * Converts this GetKeyRingRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.GetKeyRingRequest - * @instance - * @returns {Object.} JSON object - */ - GetKeyRingRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return GetKeyRingRequest; - })(); + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; - v1.GetCryptoKeyRequest = (function() { + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; - /** - * Properties of a GetCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @interface IGetCryptoKeyRequest - * @property {string|null} [name] GetCryptoKeyRequest name - */ + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; - /** - * Constructs a new GetCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a GetCryptoKeyRequest. - * @implements IGetCryptoKeyRequest - * @constructor - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest=} [properties] Properties to set - */ - function GetCryptoKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; - /** - * GetCryptoKeyRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @instance - */ - GetCryptoKeyRequest.prototype.name = ""; + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; - /** - * Creates a new GetCryptoKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest instance - */ - GetCryptoKeyRequest.create = function create(properties) { - return new GetCryptoKeyRequest(properties); - }; + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; - /** - * Encodes the specified GetCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} message GetCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCryptoKeyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; - /** - * Encodes the specified GetCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} message GetCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; - /** - * Decodes a GetCryptoKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCryptoKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetCryptoKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; - /** - * Decodes a GetCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCryptoKeyRequest message. - * @function verify - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCryptoKeyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest - */ - GetCryptoKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.GetCryptoKeyRequest) - return object; - var message = new $root.google.cloud.kms.v1.GetCryptoKeyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; - /** - * Creates a plain object from a GetCryptoKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.GetCryptoKeyRequest} message GetCryptoKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCryptoKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Converts this GetCryptoKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.GetCryptoKeyRequest - * @instance - * @returns {Object.} JSON object - */ - GetCryptoKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); - return GetCryptoKeyRequest; - })(); + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; - v1.GetCryptoKeyVersionRequest = (function() { + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; - /** - * Properties of a GetCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IGetCryptoKeyVersionRequest - * @property {string|null} [name] GetCryptoKeyVersionRequest name - */ + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new GetCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a GetCryptoKeyVersionRequest. - * @implements IGetCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest=} [properties] Properties to set - */ - function GetCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * GetCryptoKeyVersionRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @instance - */ - GetCryptoKeyVersionRequest.prototype.name = ""; + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new GetCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest instance - */ - GetCryptoKeyVersionRequest.create = function create(properties) { - return new GetCryptoKeyVersionRequest(properties); - }; + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; - /** - * Encodes the specified GetCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; - /** - * Encodes the specified GetCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; - /** - * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return HttpRule; + })(); - /** - * Verifies a GetCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + api.CustomHttpPattern = (function() { - /** - * Creates a GetCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest - */ - GetCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ - /** - * Creates a plain object from a GetCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.GetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this GetCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; - return GetCryptoKeyVersionRequest; - })(); + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; - v1.GetPublicKeyRequest = (function() { + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; - /** - * Properties of a GetPublicKeyRequest. - * @memberof google.cloud.kms.v1 - * @interface IGetPublicKeyRequest - * @property {string|null} [name] GetPublicKeyRequest name - */ + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; - /** - * Constructs a new GetPublicKeyRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a GetPublicKeyRequest. - * @implements IGetPublicKeyRequest - * @constructor - * @param {google.cloud.kms.v1.IGetPublicKeyRequest=} [properties] Properties to set - */ - function GetPublicKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * GetPublicKeyRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @instance - */ - GetPublicKeyRequest.prototype.name = ""; + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new GetPublicKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetPublicKeyRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest instance - */ - GetPublicKeyRequest.create = function create(properties) { - return new GetPublicKeyRequest(properties); - }; + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified GetPublicKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetPublicKeyRequest} message GetPublicKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPublicKeyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {google.cloud.kms.v1.IGetPublicKeyRequest} message GetPublicKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; - /** - * Decodes a GetPublicKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPublicKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetPublicKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; - /** - * Decodes a GetPublicKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; - /** - * Verifies a GetPublicKeyRequest message. - * @function verify - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPublicKeyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a GetPublicKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest - */ - GetPublicKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.GetPublicKeyRequest) - return object; - var message = new $root.google.cloud.kms.v1.GetPublicKeyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + return CustomHttpPattern; + })(); - /** - * Creates a plain object from a GetPublicKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @static - * @param {google.cloud.kms.v1.GetPublicKeyRequest} message GetPublicKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPublicKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); - /** - * Converts this GetPublicKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.GetPublicKeyRequest - * @instance - * @returns {Object.} JSON object - */ - GetPublicKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + api.ResourceDescriptor = (function() { - return GetPublicKeyRequest; - })(); + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ - v1.GetImportJobRequest = (function() { + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a GetImportJobRequest. - * @memberof google.cloud.kms.v1 - * @interface IGetImportJobRequest - * @property {string|null} [name] GetImportJobRequest name - */ + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; - /** - * Constructs a new GetImportJobRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a GetImportJobRequest. - * @implements IGetImportJobRequest - * @constructor - * @param {google.cloud.kms.v1.IGetImportJobRequest=} [properties] Properties to set - */ - function GetImportJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetImportJobRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @instance - */ - GetImportJobRequest.prototype.name = ""; - - /** - * Creates a new GetImportJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {google.cloud.kms.v1.IGetImportJobRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest instance - */ - GetImportJobRequest.create = function create(properties) { - return new GetImportJobRequest(properties); - }; - - /** - * Encodes the specified GetImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {google.cloud.kms.v1.IGetImportJobRequest} message GetImportJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetImportJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {google.cloud.kms.v1.IGetImportJobRequest} message GetImportJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetImportJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetImportJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetImportJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetImportJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; - /** - * Decodes a GetImportJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetImportJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; - /** - * Verifies a GetImportJobRequest message. - * @function verify - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetImportJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; - /** - * Creates a GetImportJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest - */ - GetImportJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.GetImportJobRequest) - return object; - var message = new $root.google.cloud.kms.v1.GetImportJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; - /** - * Creates a plain object from a GetImportJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @static - * @param {google.cloud.kms.v1.GetImportJobRequest} message GetImportJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetImportJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; - /** - * Converts this GetImportJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.GetImportJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetImportJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; - return GetImportJobRequest; - })(); + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; - v1.CreateKeyRingRequest = (function() { + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a CreateKeyRingRequest. - * @memberof google.cloud.kms.v1 - * @interface ICreateKeyRingRequest - * @property {string|null} [parent] CreateKeyRingRequest parent - * @property {string|null} [keyRingId] CreateKeyRingRequest keyRingId - * @property {google.cloud.kms.v1.IKeyRing|null} [keyRing] CreateKeyRingRequest keyRing - */ - - /** - * Constructs a new CreateKeyRingRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CreateKeyRingRequest. - * @implements ICreateKeyRingRequest - * @constructor - * @param {google.cloud.kms.v1.ICreateKeyRingRequest=} [properties] Properties to set - */ - function CreateKeyRingRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * CreateKeyRingRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @instance - */ - CreateKeyRingRequest.prototype.parent = ""; - - /** - * CreateKeyRingRequest keyRingId. - * @member {string} keyRingId - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @instance - */ - CreateKeyRingRequest.prototype.keyRingId = ""; + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * CreateKeyRingRequest keyRing. - * @member {google.cloud.kms.v1.IKeyRing|null|undefined} keyRing - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @instance - */ - CreateKeyRingRequest.prototype.keyRing = null; + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; - /** - * Creates a new CreateKeyRingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {google.cloud.kms.v1.ICreateKeyRingRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest instance - */ - CreateKeyRingRequest.create = function create(properties) { - return new CreateKeyRingRequest(properties); - }; + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; - /** - * Encodes the specified CreateKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {google.cloud.kms.v1.ICreateKeyRingRequest} message CreateKeyRingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateKeyRingRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.keyRingId); - if (message.keyRing != null && message.hasOwnProperty("keyRing")) - $root.google.cloud.kms.v1.KeyRing.encode(message.keyRing, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; - /** - * Encodes the specified CreateKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {google.cloud.kms.v1.ICreateKeyRingRequest} message CreateKeyRingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateKeyRingRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a CreateKeyRingRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateKeyRingRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateKeyRingRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.keyRingId = reader.string(); - break; - case 3: - message.keyRing = $root.google.cloud.kms.v1.KeyRing.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); - /** - * Decodes a CreateKeyRingRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateKeyRingRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ResourceDescriptor; + })(); - /** - * Verifies a CreateKeyRingRequest message. - * @function verify - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateKeyRingRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) - if (!$util.isString(message.keyRingId)) - return "keyRingId: string expected"; - if (message.keyRing != null && message.hasOwnProperty("keyRing")) { - var error = $root.google.cloud.kms.v1.KeyRing.verify(message.keyRing); - if (error) - return "keyRing." + error; - } - return null; - }; + api.ResourceReference = (function() { - /** - * Creates a CreateKeyRingRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest - */ - CreateKeyRingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CreateKeyRingRequest) - return object; - var message = new $root.google.cloud.kms.v1.CreateKeyRingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.keyRingId != null) - message.keyRingId = String(object.keyRingId); - if (object.keyRing != null) { - if (typeof object.keyRing !== "object") - throw TypeError(".google.cloud.kms.v1.CreateKeyRingRequest.keyRing: object expected"); - message.keyRing = $root.google.cloud.kms.v1.KeyRing.fromObject(object.keyRing); - } - return message; - }; + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ - /** - * Creates a plain object from a CreateKeyRingRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @static - * @param {google.cloud.kms.v1.CreateKeyRingRequest} message CreateKeyRingRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateKeyRingRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.keyRingId = ""; - object.keyRing = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) - object.keyRingId = message.keyRingId; - if (message.keyRing != null && message.hasOwnProperty("keyRing")) - object.keyRing = $root.google.cloud.kms.v1.KeyRing.toObject(message.keyRing, options); - return object; - }; + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this CreateKeyRingRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CreateKeyRingRequest - * @instance - * @returns {Object.} JSON object - */ - CreateKeyRingRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; - return CreateKeyRingRequest; - })(); + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; - v1.CreateCryptoKeyRequest = (function() { + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; - /** - * Properties of a CreateCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @interface ICreateCryptoKeyRequest - * @property {string|null} [parent] CreateCryptoKeyRequest parent - * @property {string|null} [cryptoKeyId] CreateCryptoKeyRequest cryptoKeyId - * @property {google.cloud.kms.v1.ICryptoKey|null} [cryptoKey] CreateCryptoKeyRequest cryptoKey - * @property {boolean|null} [skipInitialVersionCreation] CreateCryptoKeyRequest skipInitialVersionCreation - */ + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; - /** - * Constructs a new CreateCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CreateCryptoKeyRequest. - * @implements ICreateCryptoKeyRequest - * @constructor - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest=} [properties] Properties to set - */ - function CreateCryptoKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * CreateCryptoKeyRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @instance - */ - CreateCryptoKeyRequest.prototype.parent = ""; + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * CreateCryptoKeyRequest cryptoKeyId. - * @member {string} cryptoKeyId - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @instance - */ - CreateCryptoKeyRequest.prototype.cryptoKeyId = ""; + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; - /** - * CreateCryptoKeyRequest cryptoKey. - * @member {google.cloud.kms.v1.ICryptoKey|null|undefined} cryptoKey - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @instance - */ - CreateCryptoKeyRequest.prototype.cryptoKey = null; + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; - /** - * CreateCryptoKeyRequest skipInitialVersionCreation. - * @member {boolean} skipInitialVersionCreation - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @instance - */ - CreateCryptoKeyRequest.prototype.skipInitialVersionCreation = false; + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; - /** - * Creates a new CreateCryptoKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest instance - */ - CreateCryptoKeyRequest.create = function create(properties) { - return new CreateCryptoKeyRequest(properties); - }; + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified CreateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} message CreateCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCryptoKeyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cryptoKeyId); - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) - $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipInitialVersionCreation); - return writer; - }; + return ResourceReference; + })(); - /** - * Encodes the specified CreateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} message CreateCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return api; + })(); - /** - * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCryptoKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateCryptoKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.cryptoKeyId = reader.string(); - break; - case 3: - message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32()); - break; - case 5: - message.skipInitialVersionCreation = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + google.protobuf = (function() { - /** - * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; - /** - * Verifies a CreateCryptoKeyRequest message. - * @function verify - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCryptoKeyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) - if (!$util.isString(message.cryptoKeyId)) - return "cryptoKeyId: string expected"; - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { - var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKey); - if (error) - return "cryptoKey." + error; - } - if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) - if (typeof message.skipInitialVersionCreation !== "boolean") - return "skipInitialVersionCreation: boolean expected"; - return null; - }; + protobuf.FileDescriptorSet = (function() { - /** - * Creates a CreateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest - */ - CreateCryptoKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CreateCryptoKeyRequest) - return object; - var message = new $root.google.cloud.kms.v1.CreateCryptoKeyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.cryptoKeyId != null) - message.cryptoKeyId = String(object.cryptoKeyId); - if (object.cryptoKey != null) { - if (typeof object.cryptoKey !== "object") - throw TypeError(".google.cloud.kms.v1.CreateCryptoKeyRequest.cryptoKey: object expected"); - message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKey); - } - if (object.skipInitialVersionCreation != null) - message.skipInitialVersionCreation = Boolean(object.skipInitialVersionCreation); - return message; - }; + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ - /** - * Creates a plain object from a CreateCryptoKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.CreateCryptoKeyRequest} message CreateCryptoKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCryptoKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.cryptoKeyId = ""; - object.cryptoKey = null; - object.skipInitialVersionCreation = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) - object.cryptoKeyId = message.cryptoKeyId; - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) - object.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKey, options); - if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) - object.skipInitialVersionCreation = message.skipInitialVersionCreation; - return object; - }; + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this CreateCryptoKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCryptoKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; - return CreateCryptoKeyRequest; - })(); + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; - v1.CreateCryptoKeyVersionRequest = (function() { + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Properties of a CreateCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface ICreateCryptoKeyVersionRequest - * @property {string|null} [parent] CreateCryptoKeyVersionRequest parent - * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [cryptoKeyVersion] CreateCryptoKeyVersionRequest cryptoKeyVersion - */ + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new CreateCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CreateCryptoKeyVersionRequest. - * @implements ICreateCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest=} [properties] Properties to set - */ - function CreateCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * CreateCryptoKeyVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @instance - */ - CreateCryptoKeyVersionRequest.prototype.parent = ""; - - /** - * CreateCryptoKeyVersionRequest cryptoKeyVersion. - * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} cryptoKeyVersion - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @instance - */ - CreateCryptoKeyVersionRequest.prototype.cryptoKeyVersion = null; + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new CreateCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest instance - */ - CreateCryptoKeyVersionRequest.create = function create(properties) { - return new CreateCryptoKeyVersionRequest(properties); - }; - - /** - * Encodes the specified CreateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) - $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; - /** - * Encodes the specified CreateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; - /** - * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; - /** - * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a CreateCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) { - var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersion); - if (error) - return "cryptoKeyVersion." + error; - } - return null; - }; + return FileDescriptorSet; + })(); - /** - * Creates a CreateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest - */ - CreateCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.cryptoKeyVersion != null) { - if (typeof object.cryptoKeyVersion !== "object") - throw TypeError(".google.cloud.kms.v1.CreateCryptoKeyVersionRequest.cryptoKeyVersion: object expected"); - message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersion); - } - return message; - }; + protobuf.FileDescriptorProto = (function() { - /** - * Creates a plain object from a CreateCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.cryptoKeyVersion = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) - object.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersion, options); - return object; - }; + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ - /** - * Converts this CreateCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return CreateCryptoKeyVersionRequest; - })(); + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; - v1.ImportCryptoKeyVersionRequest = (function() { + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; - /** - * Properties of an ImportCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IImportCryptoKeyVersionRequest - * @property {string|null} [parent] ImportCryptoKeyVersionRequest parent - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] ImportCryptoKeyVersionRequest algorithm - * @property {string|null} [importJob] ImportCryptoKeyVersionRequest importJob - * @property {Uint8Array|null} [rsaAesWrappedKey] ImportCryptoKeyVersionRequest rsaAesWrappedKey - */ + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; - /** - * Constructs a new ImportCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an ImportCryptoKeyVersionRequest. - * @implements IImportCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest=} [properties] Properties to set - */ - function ImportCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - /** - * ImportCryptoKeyVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - */ - ImportCryptoKeyVersionRequest.prototype.parent = ""; + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - /** - * ImportCryptoKeyVersionRequest algorithm. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - */ - ImportCryptoKeyVersionRequest.prototype.algorithm = 0; + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; - /** - * ImportCryptoKeyVersionRequest importJob. - * @member {string} importJob - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - */ - ImportCryptoKeyVersionRequest.prototype.importJob = ""; + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; - /** - * ImportCryptoKeyVersionRequest rsaAesWrappedKey. - * @member {Uint8Array} rsaAesWrappedKey - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - */ - ImportCryptoKeyVersionRequest.prototype.rsaAesWrappedKey = $util.newBuffer([]); + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; - /** - * ImportCryptoKeyVersionRequest wrappedKeyMaterial. - * @member {"rsaAesWrappedKey"|undefined} wrappedKeyMaterial - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - */ - Object.defineProperty(ImportCryptoKeyVersionRequest.prototype, "wrappedKeyMaterial", { - get: $util.oneOfGetter($oneOfFields = ["rsaAesWrappedKey"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; - /** - * Creates a new ImportCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest instance - */ - ImportCryptoKeyVersionRequest.create = function create(properties) { - return new ImportCryptoKeyVersionRequest(properties); - }; + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; - /** - * Encodes the specified ImportCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); - if (message.importJob != null && message.hasOwnProperty("importJob")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.importJob); - if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.rsaAesWrappedKey); - return writer; - }; + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; - /** - * Encodes the specified ImportCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; - /** - * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.algorithm = reader.int32(); - break; - case 4: - message.importJob = reader.string(); - break; - case 5: - message.rsaAesWrappedKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; - /** - * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies an ImportCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 15: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 17: - case 12: - case 13: - break; - } - if (message.importJob != null && message.hasOwnProperty("importJob")) - if (!$util.isString(message.importJob)) - return "importJob: string expected"; - if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) { - properties.wrappedKeyMaterial = 1; - if (!(message.rsaAesWrappedKey && typeof message.rsaAesWrappedKey.length === "number" || $util.isString(message.rsaAesWrappedKey))) - return "rsaAesWrappedKey: buffer expected"; - } - return null; - }; + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates an ImportCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest - */ - ImportCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.algorithm) { - case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "GOOGLE_SYMMETRIC_ENCRYPTION": - case 1: - message.algorithm = 1; - break; - case "RSA_SIGN_PSS_2048_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_SIGN_PSS_3072_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_SIGN_PSS_4096_SHA256": - case 4: - message.algorithm = 4; - break; - case "RSA_SIGN_PSS_4096_SHA512": - case 15: - message.algorithm = 15; - break; - case "RSA_SIGN_PKCS1_2048_SHA256": - case 5: - message.algorithm = 5; - break; - case "RSA_SIGN_PKCS1_3072_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_SIGN_PKCS1_4096_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_SIGN_PKCS1_4096_SHA512": - case 16: - message.algorithm = 16; - break; - case "RSA_DECRYPT_OAEP_2048_SHA256": - case 8: - message.algorithm = 8; - break; - case "RSA_DECRYPT_OAEP_3072_SHA256": - case 9: - message.algorithm = 9; - break; - case "RSA_DECRYPT_OAEP_4096_SHA256": - case 10: - message.algorithm = 10; - break; - case "RSA_DECRYPT_OAEP_4096_SHA512": - case 17: - message.algorithm = 17; - break; - case "EC_SIGN_P256_SHA256": - case 12: - message.algorithm = 12; - break; - case "EC_SIGN_P384_SHA384": - case 13: - message.algorithm = 13; - break; - } - if (object.importJob != null) - message.importJob = String(object.importJob); - if (object.rsaAesWrappedKey != null) - if (typeof object.rsaAesWrappedKey === "string") - $util.base64.decode(object.rsaAesWrappedKey, message.rsaAesWrappedKey = $util.newBuffer($util.base64.length(object.rsaAesWrappedKey)), 0); - else if (object.rsaAesWrappedKey.length) - message.rsaAesWrappedKey = object.rsaAesWrappedKey; - return message; - }; - - /** - * Creates a plain object from an ImportCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; - object.importJob = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; - if (message.importJob != null && message.hasOwnProperty("importJob")) - object.importJob = message.importJob; - if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) { - object.rsaAesWrappedKey = options.bytes === String ? $util.base64.encode(message.rsaAesWrappedKey, 0, message.rsaAesWrappedKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rsaAesWrappedKey) : message.rsaAesWrappedKey; - if (options.oneofs) - object.wrappedKeyMaterial = "rsaAesWrappedKey"; - } - return object; - }; - - /** - * Converts this ImportCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - ImportCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ImportCryptoKeyVersionRequest; - })(); - - v1.CreateImportJobRequest = (function() { - - /** - * Properties of a CreateImportJobRequest. - * @memberof google.cloud.kms.v1 - * @interface ICreateImportJobRequest - * @property {string|null} [parent] CreateImportJobRequest parent - * @property {string|null} [importJobId] CreateImportJobRequest importJobId - * @property {google.cloud.kms.v1.IImportJob|null} [importJob] CreateImportJobRequest importJob - */ + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new CreateImportJobRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CreateImportJobRequest. - * @implements ICreateImportJobRequest - * @constructor - * @param {google.cloud.kms.v1.ICreateImportJobRequest=} [properties] Properties to set - */ - function CreateImportJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; - /** - * CreateImportJobRequest parent. - * @member {string} parent - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @instance - */ - CreateImportJobRequest.prototype.parent = ""; - - /** - * CreateImportJobRequest importJobId. - * @member {string} importJobId - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @instance - */ - CreateImportJobRequest.prototype.importJobId = ""; - - /** - * CreateImportJobRequest importJob. - * @member {google.cloud.kms.v1.IImportJob|null|undefined} importJob - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @instance - */ - CreateImportJobRequest.prototype.importJob = null; - - /** - * Creates a new CreateImportJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {google.cloud.kms.v1.ICreateImportJobRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest instance - */ - CreateImportJobRequest.create = function create(properties) { - return new CreateImportJobRequest(properties); - }; + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; - /** - * Encodes the specified CreateImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {google.cloud.kms.v1.ICreateImportJobRequest} message CreateImportJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateImportJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.importJobId != null && message.hasOwnProperty("importJobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.importJobId); - if (message.importJob != null && message.hasOwnProperty("importJob")) - $root.google.cloud.kms.v1.ImportJob.encode(message.importJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; - /** - * Encodes the specified CreateImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {google.cloud.kms.v1.ICreateImportJobRequest} message CreateImportJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateImportJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a CreateImportJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateImportJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateImportJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.importJobId = reader.string(); - break; - case 3: - message.importJob = $root.google.cloud.kms.v1.ImportJob.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return FileDescriptorProto; + })(); - /** - * Decodes a CreateImportJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateImportJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateImportJobRequest message. - * @function verify - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateImportJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.importJobId != null && message.hasOwnProperty("importJobId")) - if (!$util.isString(message.importJobId)) - return "importJobId: string expected"; - if (message.importJob != null && message.hasOwnProperty("importJob")) { - var error = $root.google.cloud.kms.v1.ImportJob.verify(message.importJob); - if (error) - return "importJob." + error; - } - return null; - }; + protobuf.DescriptorProto = (function() { - /** - * Creates a CreateImportJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest - */ - CreateImportJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CreateImportJobRequest) - return object; - var message = new $root.google.cloud.kms.v1.CreateImportJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.importJobId != null) - message.importJobId = String(object.importJobId); - if (object.importJob != null) { - if (typeof object.importJob !== "object") - throw TypeError(".google.cloud.kms.v1.CreateImportJobRequest.importJob: object expected"); - message.importJob = $root.google.cloud.kms.v1.ImportJob.fromObject(object.importJob); - } - return message; - }; + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ - /** - * Creates a plain object from a CreateImportJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @static - * @param {google.cloud.kms.v1.CreateImportJobRequest} message CreateImportJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateImportJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.importJobId = ""; - object.importJob = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.importJobId != null && message.hasOwnProperty("importJobId")) - object.importJobId = message.importJobId; - if (message.importJob != null && message.hasOwnProperty("importJob")) - object.importJob = $root.google.cloud.kms.v1.ImportJob.toObject(message.importJob, options); - return object; - }; + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this CreateImportJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CreateImportJobRequest - * @instance - * @returns {Object.} JSON object - */ - CreateImportJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; - return CreateImportJobRequest; - })(); + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; - v1.UpdateCryptoKeyRequest = (function() { + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; - /** - * Properties of an UpdateCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @interface IUpdateCryptoKeyRequest - * @property {google.cloud.kms.v1.ICryptoKey|null} [cryptoKey] UpdateCryptoKeyRequest cryptoKey - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCryptoKeyRequest updateMask - */ + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; - /** - * Constructs a new UpdateCryptoKeyRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an UpdateCryptoKeyRequest. - * @implements IUpdateCryptoKeyRequest - * @constructor - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest=} [properties] Properties to set - */ - function UpdateCryptoKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; - /** - * UpdateCryptoKeyRequest cryptoKey. - * @member {google.cloud.kms.v1.ICryptoKey|null|undefined} cryptoKey - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @instance - */ - UpdateCryptoKeyRequest.prototype.cryptoKey = null; + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; - /** - * UpdateCryptoKeyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @instance - */ - UpdateCryptoKeyRequest.prototype.updateMask = null; + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; - /** - * Creates a new UpdateCryptoKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest instance - */ - UpdateCryptoKeyRequest.create = function create(properties) { - return new UpdateCryptoKeyRequest(properties); - }; + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; - /** - * Encodes the specified UpdateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} message UpdateCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) - $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Encodes the specified UpdateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} message UpdateCryptoKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; - /** - * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; - /** - * Verifies an UpdateCryptoKeyRequest message. - * @function verify - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCryptoKeyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { - var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKey); - if (error) - return "cryptoKey." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates an UpdateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest - */ - UpdateCryptoKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyRequest) - return object; - var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyRequest(); - if (object.cryptoKey != null) { - if (typeof object.cryptoKey !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyRequest.cryptoKey: object expected"); - message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKey); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from an UpdateCryptoKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @static - * @param {google.cloud.kms.v1.UpdateCryptoKeyRequest} message UpdateCryptoKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCryptoKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cryptoKey = null; - object.updateMask = null; - } - if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) - object.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKey, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateCryptoKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCryptoKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateCryptoKeyRequest; - })(); - - v1.UpdateCryptoKeyVersionRequest = (function() { + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of an UpdateCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IUpdateCryptoKeyVersionRequest - * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [cryptoKeyVersion] UpdateCryptoKeyVersionRequest cryptoKeyVersion - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCryptoKeyVersionRequest updateMask - */ + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; - /** - * Constructs a new UpdateCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an UpdateCryptoKeyVersionRequest. - * @implements IUpdateCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest=} [properties] Properties to set - */ - function UpdateCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; - /** - * UpdateCryptoKeyVersionRequest cryptoKeyVersion. - * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} cryptoKeyVersion - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @instance - */ - UpdateCryptoKeyVersionRequest.prototype.cryptoKeyVersion = null; + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; - /** - * UpdateCryptoKeyVersionRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @instance - */ - UpdateCryptoKeyVersionRequest.prototype.updateMask = null; + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new UpdateCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest instance - */ - UpdateCryptoKeyVersionRequest.create = function create(properties) { - return new UpdateCryptoKeyVersionRequest(properties); - }; + DescriptorProto.ExtensionRange = (function() { - /** - * Encodes the specified UpdateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) - $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ - /** - * Encodes the specified UpdateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; - /** - * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; - /** - * Verifies an UpdateCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) { - var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersion); - if (error) - return "cryptoKeyVersion." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; - /** - * Creates an UpdateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest - */ - UpdateCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest(); - if (object.cryptoKeyVersion != null) { - if (typeof object.cryptoKeyVersion !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.cryptoKeyVersion: object expected"); - message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersion); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cryptoKeyVersion = null; - object.updateMask = null; - } - if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) - object.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersion, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; - /** - * Converts this UpdateCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - return UpdateCryptoKeyVersionRequest; - })(); + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1.EncryptRequest = (function() { + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an EncryptRequest. - * @memberof google.cloud.kms.v1 - * @interface IEncryptRequest - * @property {string|null} [name] EncryptRequest name - * @property {Uint8Array|null} [plaintext] EncryptRequest plaintext - * @property {Uint8Array|null} [additionalAuthenticatedData] EncryptRequest additionalAuthenticatedData - */ + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new EncryptRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an EncryptRequest. - * @implements IEncryptRequest - * @constructor - * @param {google.cloud.kms.v1.IEncryptRequest=} [properties] Properties to set - */ - function EncryptRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; } + return null; + }; - /** - * EncryptRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.EncryptRequest - * @instance - */ - EncryptRequest.prototype.name = ""; + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; - /** - * EncryptRequest plaintext. - * @member {Uint8Array} plaintext - * @memberof google.cloud.kms.v1.EncryptRequest - * @instance - */ - EncryptRequest.prototype.plaintext = $util.newBuffer([]); + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; - /** - * EncryptRequest additionalAuthenticatedData. - * @member {Uint8Array} additionalAuthenticatedData - * @memberof google.cloud.kms.v1.EncryptRequest - * @instance - */ - EncryptRequest.prototype.additionalAuthenticatedData = $util.newBuffer([]); - - /** - * Creates a new EncryptRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {google.cloud.kms.v1.IEncryptRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest instance - */ - EncryptRequest.create = function create(properties) { - return new EncryptRequest(properties); - }; - - /** - * Encodes the specified EncryptRequest message. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {google.cloud.kms.v1.IEncryptRequest} message EncryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.plaintext); - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.additionalAuthenticatedData); - return writer; - }; - - /** - * Encodes the specified EncryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {google.cloud.kms.v1.IEncryptRequest} message EncryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an EncryptRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.EncryptRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.plaintext = reader.bytes(); - break; - case 3: - message.additionalAuthenticatedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return ExtensionRange; + })(); - /** - * Decodes an EncryptRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + DescriptorProto.ReservedRange = (function() { - /** - * Verifies an EncryptRequest message. - * @function verify - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) - return "plaintext: buffer expected"; - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - if (!(message.additionalAuthenticatedData && typeof message.additionalAuthenticatedData.length === "number" || $util.isString(message.additionalAuthenticatedData))) - return "additionalAuthenticatedData: buffer expected"; - return null; - }; + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ - /** - * Creates an EncryptRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest - */ - EncryptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.EncryptRequest) - return object; - var message = new $root.google.cloud.kms.v1.EncryptRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.plaintext != null) - if (typeof object.plaintext === "string") - $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); - else if (object.plaintext.length) - message.plaintext = object.plaintext; - if (object.additionalAuthenticatedData != null) - if (typeof object.additionalAuthenticatedData === "string") - $util.base64.decode(object.additionalAuthenticatedData, message.additionalAuthenticatedData = $util.newBuffer($util.base64.length(object.additionalAuthenticatedData)), 0); - else if (object.additionalAuthenticatedData.length) - message.additionalAuthenticatedData = object.additionalAuthenticatedData; - return message; - }; + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from an EncryptRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.EncryptRequest - * @static - * @param {google.cloud.kms.v1.EncryptRequest} message EncryptRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if (options.bytes === String) - object.plaintext = ""; - else { - object.plaintext = []; - if (options.bytes !== Array) - object.plaintext = $util.newBuffer(object.plaintext); - } - if (options.bytes === String) - object.additionalAuthenticatedData = ""; - else { - object.additionalAuthenticatedData = []; - if (options.bytes !== Array) - object.additionalAuthenticatedData = $util.newBuffer(object.additionalAuthenticatedData); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - object.additionalAuthenticatedData = options.bytes === String ? $util.base64.encode(message.additionalAuthenticatedData, 0, message.additionalAuthenticatedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.additionalAuthenticatedData) : message.additionalAuthenticatedData; - return object; - }; + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; - /** - * Converts this EncryptRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.EncryptRequest - * @instance - * @returns {Object.} JSON object - */ - EncryptRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; - return EncryptRequest; - })(); + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; - v1.DecryptRequest = (function() { + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; - /** - * Properties of a DecryptRequest. - * @memberof google.cloud.kms.v1 - * @interface IDecryptRequest - * @property {string|null} [name] DecryptRequest name - * @property {Uint8Array|null} [ciphertext] DecryptRequest ciphertext - * @property {Uint8Array|null} [additionalAuthenticatedData] DecryptRequest additionalAuthenticatedData - */ + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new DecryptRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a DecryptRequest. - * @implements IDecryptRequest - * @constructor - * @param {google.cloud.kms.v1.IDecryptRequest=} [properties] Properties to set - */ - function DecryptRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * DecryptRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.DecryptRequest - * @instance - */ - DecryptRequest.prototype.name = ""; + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * DecryptRequest ciphertext. - * @member {Uint8Array} ciphertext - * @memberof google.cloud.kms.v1.DecryptRequest - * @instance - */ - DecryptRequest.prototype.ciphertext = $util.newBuffer([]); + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; - /** - * DecryptRequest additionalAuthenticatedData. - * @member {Uint8Array} additionalAuthenticatedData - * @memberof google.cloud.kms.v1.DecryptRequest - * @instance - */ - DecryptRequest.prototype.additionalAuthenticatedData = $util.newBuffer([]); + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; - /** - * Creates a new DecryptRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {google.cloud.kms.v1.IDecryptRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest instance - */ - DecryptRequest.create = function create(properties) { - return new DecryptRequest(properties); - }; + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; - /** - * Encodes the specified DecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {google.cloud.kms.v1.IDecryptRequest} message DecryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecryptRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ciphertext); - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.additionalAuthenticatedData); - return writer; - }; + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified DecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {google.cloud.kms.v1.IDecryptRequest} message DecryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return ReservedRange; + })(); - /** - * Decodes a DecryptRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecryptRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DecryptRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.ciphertext = reader.bytes(); - break; - case 3: - message.additionalAuthenticatedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecryptRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecryptRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return DescriptorProto; + })(); - /** - * Verifies a DecryptRequest message. - * @function verify - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecryptRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) - return "ciphertext: buffer expected"; - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - if (!(message.additionalAuthenticatedData && typeof message.additionalAuthenticatedData.length === "number" || $util.isString(message.additionalAuthenticatedData))) - return "additionalAuthenticatedData: buffer expected"; - return null; - }; + protobuf.ExtensionRangeOptions = (function() { - /** - * Creates a DecryptRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest - */ - DecryptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.DecryptRequest) - return object; - var message = new $root.google.cloud.kms.v1.DecryptRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.ciphertext != null) - if (typeof object.ciphertext === "string") - $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); - else if (object.ciphertext.length) - message.ciphertext = object.ciphertext; - if (object.additionalAuthenticatedData != null) - if (typeof object.additionalAuthenticatedData === "string") - $util.base64.decode(object.additionalAuthenticatedData, message.additionalAuthenticatedData = $util.newBuffer($util.base64.length(object.additionalAuthenticatedData)), 0); - else if (object.additionalAuthenticatedData.length) - message.additionalAuthenticatedData = object.additionalAuthenticatedData; - return message; - }; + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ - /** - * Creates a plain object from a DecryptRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.DecryptRequest - * @static - * @param {google.cloud.kms.v1.DecryptRequest} message DecryptRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecryptRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if (options.bytes === String) - object.ciphertext = ""; - else { - object.ciphertext = []; - if (options.bytes !== Array) - object.ciphertext = $util.newBuffer(object.ciphertext); - } - if (options.bytes === String) - object.additionalAuthenticatedData = ""; - else { - object.additionalAuthenticatedData = []; - if (options.bytes !== Array) - object.additionalAuthenticatedData = $util.newBuffer(object.additionalAuthenticatedData); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; - if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) - object.additionalAuthenticatedData = options.bytes === String ? $util.base64.encode(message.additionalAuthenticatedData, 0, message.additionalAuthenticatedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.additionalAuthenticatedData) : message.additionalAuthenticatedData; - return object; - }; + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this DecryptRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.DecryptRequest - * @instance - * @returns {Object.} JSON object - */ - DecryptRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - return DecryptRequest; - })(); + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; - v1.AsymmetricSignRequest = (function() { + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Properties of an AsymmetricSignRequest. - * @memberof google.cloud.kms.v1 - * @interface IAsymmetricSignRequest - * @property {string|null} [name] AsymmetricSignRequest name - * @property {google.cloud.kms.v1.IDigest|null} [digest] AsymmetricSignRequest digest - */ + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new AsymmetricSignRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an AsymmetricSignRequest. - * @implements IAsymmetricSignRequest - * @constructor - * @param {google.cloud.kms.v1.IAsymmetricSignRequest=} [properties] Properties to set - */ - function AsymmetricSignRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * AsymmetricSignRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @instance - */ - AsymmetricSignRequest.prototype.name = ""; - - /** - * AsymmetricSignRequest digest. - * @member {google.cloud.kms.v1.IDigest|null|undefined} digest - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @instance - */ - AsymmetricSignRequest.prototype.digest = null; + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AsymmetricSignRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest instance - */ - AsymmetricSignRequest.create = function create(properties) { - return new AsymmetricSignRequest(properties); - }; + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Encodes the specified AsymmetricSignRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignRequest} message AsymmetricSignRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricSignRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.digest != null && message.hasOwnProperty("digest")) - $root.google.cloud.kms.v1.Digest.encode(message.digest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Encodes the specified AsymmetricSignRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignRequest} message AsymmetricSignRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricSignRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Decodes an AsymmetricSignRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricSignRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricSignRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.digest = $root.google.cloud.kms.v1.Digest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AsymmetricSignRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricSignRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ExtensionRangeOptions; + })(); - /** - * Verifies an AsymmetricSignRequest message. - * @function verify - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricSignRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.digest != null && message.hasOwnProperty("digest")) { - var error = $root.google.cloud.kms.v1.Digest.verify(message.digest); - if (error) - return "digest." + error; - } - return null; - }; + protobuf.FieldDescriptorProto = (function() { - /** - * Creates an AsymmetricSignRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest - */ - AsymmetricSignRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.AsymmetricSignRequest) - return object; - var message = new $root.google.cloud.kms.v1.AsymmetricSignRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.digest != null) { - if (typeof object.digest !== "object") - throw TypeError(".google.cloud.kms.v1.AsymmetricSignRequest.digest: object expected"); - message.digest = $root.google.cloud.kms.v1.Digest.fromObject(object.digest); - } - return message; - }; + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + */ - /** - * Creates a plain object from an AsymmetricSignRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @static - * @param {google.cloud.kms.v1.AsymmetricSignRequest} message AsymmetricSignRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricSignRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.digest = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.digest != null && message.hasOwnProperty("digest")) - object.digest = $root.google.cloud.kms.v1.Digest.toObject(message.digest, options); - return object; - }; - - /** - * Converts this AsymmetricSignRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.AsymmetricSignRequest - * @instance - * @returns {Object.} JSON object - */ - AsymmetricSignRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return AsymmetricSignRequest; - })(); + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; - v1.AsymmetricDecryptRequest = (function() { + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; - /** - * Properties of an AsymmetricDecryptRequest. - * @memberof google.cloud.kms.v1 - * @interface IAsymmetricDecryptRequest - * @property {string|null} [name] AsymmetricDecryptRequest name - * @property {Uint8Array|null} [ciphertext] AsymmetricDecryptRequest ciphertext - */ + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; - /** - * Constructs a new AsymmetricDecryptRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an AsymmetricDecryptRequest. - * @implements IAsymmetricDecryptRequest - * @constructor - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest=} [properties] Properties to set - */ - function AsymmetricDecryptRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; - /** - * AsymmetricDecryptRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @instance - */ - AsymmetricDecryptRequest.prototype.name = ""; + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; - /** - * AsymmetricDecryptRequest ciphertext. - * @member {Uint8Array} ciphertext - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @instance - */ - AsymmetricDecryptRequest.prototype.ciphertext = $util.newBuffer([]); + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; - /** - * Creates a new AsymmetricDecryptRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest instance - */ - AsymmetricDecryptRequest.create = function create(properties) { - return new AsymmetricDecryptRequest(properties); - }; + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; - /** - * Encodes the specified AsymmetricDecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} message AsymmetricDecryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricDecryptRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ciphertext); - return writer; - }; + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; - /** - * Encodes the specified AsymmetricDecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} message AsymmetricDecryptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricDecryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; - /** - * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricDecryptRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricDecryptRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.ciphertext = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; - /** - * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricDecryptRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; - /** - * Verifies an AsymmetricDecryptRequest message. - * @function verify - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricDecryptRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) - return "ciphertext: buffer expected"; - return null; - }; - - /** - * Creates an AsymmetricDecryptRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest - */ - AsymmetricDecryptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.AsymmetricDecryptRequest) - return object; - var message = new $root.google.cloud.kms.v1.AsymmetricDecryptRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.ciphertext != null) - if (typeof object.ciphertext === "string") - $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); - else if (object.ciphertext.length) - message.ciphertext = object.ciphertext; - return message; - }; - - /** - * Creates a plain object from an AsymmetricDecryptRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @static - * @param {google.cloud.kms.v1.AsymmetricDecryptRequest} message AsymmetricDecryptRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricDecryptRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if (options.bytes === String) - object.ciphertext = ""; - else { - object.ciphertext = []; - if (options.bytes !== Array) - object.ciphertext = $util.newBuffer(object.ciphertext); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; - return object; - }; - - /** - * Converts this AsymmetricDecryptRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest - * @instance - * @returns {Object.} JSON object - */ - AsymmetricDecryptRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AsymmetricDecryptRequest; - })(); - - v1.DecryptResponse = (function() { + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; - /** - * Properties of a DecryptResponse. - * @memberof google.cloud.kms.v1 - * @interface IDecryptResponse - * @property {Uint8Array|null} [plaintext] DecryptResponse plaintext - */ + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new DecryptResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a DecryptResponse. - * @implements IDecryptResponse - * @constructor - * @param {google.cloud.kms.v1.IDecryptResponse=} [properties] Properties to set - */ - function DecryptResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * DecryptResponse plaintext. - * @member {Uint8Array} plaintext - * @memberof google.cloud.kms.v1.DecryptResponse - * @instance - */ - DecryptResponse.prototype.plaintext = $util.newBuffer([]); - - /** - * Creates a new DecryptResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {google.cloud.kms.v1.IDecryptResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse instance - */ - DecryptResponse.create = function create(properties) { - return new DecryptResponse(properties); - }; - - /** - * Encodes the specified DecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {google.cloud.kms.v1.IDecryptResponse} message DecryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecryptResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.plaintext); - return writer; - }; + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified DecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {google.cloud.kms.v1.IDecryptResponse} message DecryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecryptResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecryptResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecryptResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DecryptResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.plaintext = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecryptResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecryptResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecryptResponse message. - * @function verify - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecryptResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) - return "plaintext: buffer expected"; - return null; - }; - - /** - * Creates a DecryptResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse - */ - DecryptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.DecryptResponse) - return object; - var message = new $root.google.cloud.kms.v1.DecryptResponse(); - if (object.plaintext != null) - if (typeof object.plaintext === "string") - $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); - else if (object.plaintext.length) - message.plaintext = object.plaintext; - return message; - }; - - /** - * Creates a plain object from a DecryptResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.DecryptResponse - * @static - * @param {google.cloud.kms.v1.DecryptResponse} message DecryptResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecryptResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.plaintext = ""; - else { - object.plaintext = []; - if (options.bytes !== Array) - object.plaintext = $util.newBuffer(object.plaintext); - } - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; - return object; - }; - - /** - * Converts this DecryptResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.DecryptResponse - * @instance - * @returns {Object.} JSON object - */ - DecryptResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecryptResponse; - })(); - - v1.EncryptResponse = (function() { - - /** - * Properties of an EncryptResponse. - * @memberof google.cloud.kms.v1 - * @interface IEncryptResponse - * @property {string|null} [name] EncryptResponse name - * @property {Uint8Array|null} [ciphertext] EncryptResponse ciphertext - */ - - /** - * Constructs a new EncryptResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an EncryptResponse. - * @implements IEncryptResponse - * @constructor - * @param {google.cloud.kms.v1.IEncryptResponse=} [properties] Properties to set - */ - function EncryptResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * EncryptResponse name. - * @member {string} name - * @memberof google.cloud.kms.v1.EncryptResponse - * @instance - */ - EncryptResponse.prototype.name = ""; - - /** - * EncryptResponse ciphertext. - * @member {Uint8Array} ciphertext - * @memberof google.cloud.kms.v1.EncryptResponse - * @instance - */ - EncryptResponse.prototype.ciphertext = $util.newBuffer([]); - - /** - * Creates a new EncryptResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {google.cloud.kms.v1.IEncryptResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse instance - */ - EncryptResponse.create = function create(properties) { - return new EncryptResponse(properties); - }; - - /** - * Encodes the specified EncryptResponse message. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {google.cloud.kms.v1.IEncryptResponse} message EncryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ciphertext); - return writer; - }; - - /** - * Encodes the specified EncryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {google.cloud.kms.v1.IEncryptResponse} message EncryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; - /** - * Decodes an EncryptResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.EncryptResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.ciphertext = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; - /** - * Decodes an EncryptResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies an EncryptResponse message. - * @function verify - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) - return "ciphertext: buffer expected"; - return null; - }; - - /** - * Creates an EncryptResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse - */ - EncryptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.EncryptResponse) - return object; - var message = new $root.google.cloud.kms.v1.EncryptResponse(); - if (object.name != null) - message.name = String(object.name); - if (object.ciphertext != null) - if (typeof object.ciphertext === "string") - $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); - else if (object.ciphertext.length) - message.ciphertext = object.ciphertext; - return message; - }; + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); - /** - * Creates a plain object from an EncryptResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.EncryptResponse - * @static - * @param {google.cloud.kms.v1.EncryptResponse} message EncryptResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if (options.bytes === String) - object.ciphertext = ""; - else { - object.ciphertext = []; - if (options.bytes !== Array) - object.ciphertext = $util.newBuffer(object.ciphertext); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) - object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; - return object; - }; + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); - /** - * Converts this EncryptResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.EncryptResponse - * @instance - * @returns {Object.} JSON object - */ - EncryptResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return FieldDescriptorProto; + })(); - return EncryptResponse; - })(); + protobuf.OneofDescriptorProto = (function() { - v1.AsymmetricSignResponse = (function() { + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ - /** - * Properties of an AsymmetricSignResponse. - * @memberof google.cloud.kms.v1 - * @interface IAsymmetricSignResponse - * @property {Uint8Array|null} [signature] AsymmetricSignResponse signature - */ + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new AsymmetricSignResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an AsymmetricSignResponse. - * @implements IAsymmetricSignResponse - * @constructor - * @param {google.cloud.kms.v1.IAsymmetricSignResponse=} [properties] Properties to set - */ - function AsymmetricSignResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; - /** - * AsymmetricSignResponse signature. - * @member {Uint8Array} signature - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @instance - */ - AsymmetricSignResponse.prototype.signature = $util.newBuffer([]); + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; - /** - * Creates a new AsymmetricSignResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse instance - */ - AsymmetricSignResponse.create = function create(properties) { - return new AsymmetricSignResponse(properties); - }; + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; - /** - * Encodes the specified AsymmetricSignResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignResponse} message AsymmetricSignResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricSignResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && message.hasOwnProperty("signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - return writer; - }; + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified AsymmetricSignResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricSignResponse} message AsymmetricSignResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricSignResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AsymmetricSignResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricSignResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricSignResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an AsymmetricSignResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricSignResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an AsymmetricSignResponse message. - * @function verify - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricSignResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Creates an AsymmetricSignResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse - */ - AsymmetricSignResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.AsymmetricSignResponse) - return object; - var message = new $root.google.cloud.kms.v1.AsymmetricSignResponse(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; - /** - * Creates a plain object from an AsymmetricSignResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @static - * @param {google.cloud.kms.v1.AsymmetricSignResponse} message AsymmetricSignResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricSignResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; - /** - * Converts this AsymmetricSignResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.AsymmetricSignResponse - * @instance - * @returns {Object.} JSON object - */ - AsymmetricSignResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AsymmetricSignResponse; - })(); - - v1.AsymmetricDecryptResponse = (function() { + return OneofDescriptorProto; + })(); - /** - * Properties of an AsymmetricDecryptResponse. - * @memberof google.cloud.kms.v1 - * @interface IAsymmetricDecryptResponse - * @property {Uint8Array|null} [plaintext] AsymmetricDecryptResponse plaintext - */ + protobuf.EnumDescriptorProto = (function() { - /** - * Constructs a new AsymmetricDecryptResponse. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an AsymmetricDecryptResponse. - * @implements IAsymmetricDecryptResponse - * @constructor - * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse=} [properties] Properties to set - */ - function AsymmetricDecryptResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ - /** - * AsymmetricDecryptResponse plaintext. - * @member {Uint8Array} plaintext - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @instance - */ - AsymmetricDecryptResponse.prototype.plaintext = $util.newBuffer([]); + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new AsymmetricDecryptResponse instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse=} [properties] Properties to set - * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse instance - */ - AsymmetricDecryptResponse.create = function create(properties) { - return new AsymmetricDecryptResponse(properties); - }; + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; - /** - * Encodes the specified AsymmetricDecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse} message AsymmetricDecryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricDecryptResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.plaintext); - return writer; - }; + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; - /** - * Encodes the specified AsymmetricDecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse} message AsymmetricDecryptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AsymmetricDecryptResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; - /** - * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricDecryptResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricDecryptResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.plaintext = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AsymmetricDecryptResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Verifies an AsymmetricDecryptResponse message. - * @function verify - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AsymmetricDecryptResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) - return "plaintext: buffer expected"; - return null; - }; + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; - /** - * Creates an AsymmetricDecryptResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse - */ - AsymmetricDecryptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.AsymmetricDecryptResponse) - return object; - var message = new $root.google.cloud.kms.v1.AsymmetricDecryptResponse(); - if (object.plaintext != null) - if (typeof object.plaintext === "string") - $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); - else if (object.plaintext.length) - message.plaintext = object.plaintext; - return message; - }; + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; - /** - * Creates a plain object from an AsymmetricDecryptResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @static - * @param {google.cloud.kms.v1.AsymmetricDecryptResponse} message AsymmetricDecryptResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AsymmetricDecryptResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.plaintext = ""; - else { - object.plaintext = []; - if (options.bytes !== Array) - object.plaintext = $util.newBuffer(object.plaintext); - } - if (message.plaintext != null && message.hasOwnProperty("plaintext")) - object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; - return object; - }; - - /** - * Converts this AsymmetricDecryptResponse to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse - * @instance - * @returns {Object.} JSON object - */ - AsymmetricDecryptResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AsymmetricDecryptResponse; - })(); - - v1.UpdateCryptoKeyPrimaryVersionRequest = (function() { - - /** - * Properties of an UpdateCryptoKeyPrimaryVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IUpdateCryptoKeyPrimaryVersionRequest - * @property {string|null} [name] UpdateCryptoKeyPrimaryVersionRequest name - * @property {string|null} [cryptoKeyVersionId] UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId - */ + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new UpdateCryptoKeyPrimaryVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an UpdateCryptoKeyPrimaryVersionRequest. - * @implements IUpdateCryptoKeyPrimaryVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest=} [properties] Properties to set - */ - function UpdateCryptoKeyPrimaryVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * UpdateCryptoKeyPrimaryVersionRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @instance - */ - UpdateCryptoKeyPrimaryVersionRequest.prototype.name = ""; + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId. - * @member {string} cryptoKeyVersionId - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @instance - */ - UpdateCryptoKeyPrimaryVersionRequest.prototype.cryptoKeyVersionId = ""; + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; - /** - * Creates a new UpdateCryptoKeyPrimaryVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest instance - */ - UpdateCryptoKeyPrimaryVersionRequest.create = function create(properties) { - return new UpdateCryptoKeyPrimaryVersionRequest(properties); - }; + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; - /** - * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyPrimaryVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cryptoKeyVersionId); - return writer; - }; + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; - /** - * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCryptoKeyPrimaryVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyPrimaryVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.cryptoKeyVersionId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + EnumDescriptorProto.EnumReservedRange = (function() { - /** - * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCryptoKeyPrimaryVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ - /** - * Verifies an UpdateCryptoKeyPrimaryVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCryptoKeyPrimaryVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) - if (!$util.isString(message.cryptoKeyVersionId)) - return "cryptoKeyVersionId: string expected"; - return null; - }; + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates an UpdateCryptoKeyPrimaryVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest - */ - UpdateCryptoKeyPrimaryVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.cryptoKeyVersionId != null) - message.cryptoKeyVersionId = String(object.cryptoKeyVersionId); - return message; - }; + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; - /** - * Creates a plain object from an UpdateCryptoKeyPrimaryVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @static - * @param {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCryptoKeyPrimaryVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.cryptoKeyVersionId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) - object.cryptoKeyVersionId = message.cryptoKeyVersionId; - return object; - }; + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; - /** - * Converts this UpdateCryptoKeyPrimaryVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCryptoKeyPrimaryVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; - return UpdateCryptoKeyPrimaryVersionRequest; - })(); + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; - v1.DestroyCryptoKeyVersionRequest = (function() { - - /** - * Properties of a DestroyCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IDestroyCryptoKeyVersionRequest - * @property {string|null} [name] DestroyCryptoKeyVersionRequest name - */ + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new DestroyCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a DestroyCryptoKeyVersionRequest. - * @implements IDestroyCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest=} [properties] Properties to set - */ - function DestroyCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * DestroyCryptoKeyVersionRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @instance - */ - DestroyCryptoKeyVersionRequest.prototype.name = ""; - - /** - * Creates a new DestroyCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest instance - */ - DestroyCryptoKeyVersionRequest.create = function create(properties) { - return new DestroyCryptoKeyVersionRequest(properties); - }; + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified DestroyCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; - /** - * Encodes the specified DestroyCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; - /** - * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; - /** - * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a DestroyCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DestroyCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + return EnumReservedRange; + })(); - /** - * Creates a DestroyCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest - */ - DestroyCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + return EnumDescriptorProto; + })(); - /** - * Creates a plain object from a DestroyCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DestroyCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + protobuf.EnumValueDescriptorProto = (function() { - /** - * Converts this DestroyCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DestroyCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ - return DestroyCryptoKeyVersionRequest; - })(); + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - v1.RestoreCryptoKeyVersionRequest = (function() { + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; - /** - * Properties of a RestoreCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @interface IRestoreCryptoKeyVersionRequest - * @property {string|null} [name] RestoreCryptoKeyVersionRequest name - */ + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; - /** - * Constructs a new RestoreCryptoKeyVersionRequest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a RestoreCryptoKeyVersionRequest. - * @implements IRestoreCryptoKeyVersionRequest - * @constructor - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest=} [properties] Properties to set - */ - function RestoreCryptoKeyVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; - /** - * RestoreCryptoKeyVersionRequest name. - * @member {string} name - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @instance - */ - RestoreCryptoKeyVersionRequest.prototype.name = ""; + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; - /** - * Creates a new RestoreCryptoKeyVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest instance - */ - RestoreCryptoKeyVersionRequest.create = function create(properties) { - return new RestoreCryptoKeyVersionRequest(properties); - }; + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified RestoreCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCryptoKeyVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified RestoreCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCryptoKeyVersionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Verifies a RestoreCryptoKeyVersionRequest message. - * @function verify - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreCryptoKeyVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; - /** - * Creates a RestoreCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest - */ - RestoreCryptoKeyVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest) - return object; - var message = new $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; - /** - * Creates a plain object from a RestoreCryptoKeyVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @static - * @param {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreCryptoKeyVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this RestoreCryptoKeyVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return EnumValueDescriptorProto; + })(); - return RestoreCryptoKeyVersionRequest; - })(); + protobuf.ServiceDescriptorProto = (function() { - v1.Digest = (function() { + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ - /** - * Properties of a Digest. - * @memberof google.cloud.kms.v1 - * @interface IDigest - * @property {Uint8Array|null} [sha256] Digest sha256 - * @property {Uint8Array|null} [sha384] Digest sha384 - * @property {Uint8Array|null} [sha512] Digest sha512 - */ + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new Digest. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a Digest. - * @implements IDigest - * @constructor - * @param {google.cloud.kms.v1.IDigest=} [properties] Properties to set - */ - function Digest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * Digest sha256. - * @member {Uint8Array} sha256 - * @memberof google.cloud.kms.v1.Digest - * @instance - */ - Digest.prototype.sha256 = $util.newBuffer([]); + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * Digest sha384. - * @member {Uint8Array} sha384 - * @memberof google.cloud.kms.v1.Digest - * @instance - */ - Digest.prototype.sha384 = $util.newBuffer([]); - - /** - * Digest sha512. - * @member {Uint8Array} sha512 - * @memberof google.cloud.kms.v1.Digest - * @instance - */ - Digest.prototype.sha512 = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * Digest digest. - * @member {"sha256"|"sha384"|"sha512"|undefined} digest - * @memberof google.cloud.kms.v1.Digest - * @instance - */ - Object.defineProperty(Digest.prototype, "digest", { - get: $util.oneOfGetter($oneOfFields = ["sha256", "sha384", "sha512"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; - /** - * Creates a new Digest instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {google.cloud.kms.v1.IDigest=} [properties] Properties to set - * @returns {google.cloud.kms.v1.Digest} Digest instance - */ - Digest.create = function create(properties) { - return new Digest(properties); - }; + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified Digest message. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {google.cloud.kms.v1.IDigest} message Digest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Digest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sha256 != null && message.hasOwnProperty("sha256")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.sha256); - if (message.sha384 != null && message.hasOwnProperty("sha384")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sha384); - if (message.sha512 != null && message.hasOwnProperty("sha512")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.sha512); - return writer; - }; + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Digest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {google.cloud.kms.v1.IDigest} message Digest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Digest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Digest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.Digest} Digest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Digest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.Digest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sha256 = reader.bytes(); - break; - case 2: - message.sha384 = reader.bytes(); - break; - case 3: - message.sha512 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a Digest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.Digest} Digest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Digest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Verifies a Digest message. - * @function verify - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Digest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sha256 != null && message.hasOwnProperty("sha256")) { - properties.digest = 1; - if (!(message.sha256 && typeof message.sha256.length === "number" || $util.isString(message.sha256))) - return "sha256: buffer expected"; - } - if (message.sha384 != null && message.hasOwnProperty("sha384")) { - if (properties.digest === 1) - return "digest: multiple values"; - properties.digest = 1; - if (!(message.sha384 && typeof message.sha384.length === "number" || $util.isString(message.sha384))) - return "sha384: buffer expected"; - } - if (message.sha512 != null && message.hasOwnProperty("sha512")) { - if (properties.digest === 1) - return "digest: multiple values"; - properties.digest = 1; - if (!(message.sha512 && typeof message.sha512.length === "number" || $util.isString(message.sha512))) - return "sha512: buffer expected"; - } - return null; - }; - - /** - * Creates a Digest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.Digest} Digest - */ - Digest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.Digest) - return object; - var message = new $root.google.cloud.kms.v1.Digest(); - if (object.sha256 != null) - if (typeof object.sha256 === "string") - $util.base64.decode(object.sha256, message.sha256 = $util.newBuffer($util.base64.length(object.sha256)), 0); - else if (object.sha256.length) - message.sha256 = object.sha256; - if (object.sha384 != null) - if (typeof object.sha384 === "string") - $util.base64.decode(object.sha384, message.sha384 = $util.newBuffer($util.base64.length(object.sha384)), 0); - else if (object.sha384.length) - message.sha384 = object.sha384; - if (object.sha512 != null) - if (typeof object.sha512 === "string") - $util.base64.decode(object.sha512, message.sha512 = $util.newBuffer($util.base64.length(object.sha512)), 0); - else if (object.sha512.length) - message.sha512 = object.sha512; - return message; - }; + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; - /** - * Creates a plain object from a Digest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.Digest - * @static - * @param {google.cloud.kms.v1.Digest} message Digest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Digest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.sha256 != null && message.hasOwnProperty("sha256")) { - object.sha256 = options.bytes === String ? $util.base64.encode(message.sha256, 0, message.sha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256) : message.sha256; - if (options.oneofs) - object.digest = "sha256"; - } - if (message.sha384 != null && message.hasOwnProperty("sha384")) { - object.sha384 = options.bytes === String ? $util.base64.encode(message.sha384, 0, message.sha384.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha384) : message.sha384; - if (options.oneofs) - object.digest = "sha384"; - } - if (message.sha512 != null && message.hasOwnProperty("sha512")) { - object.sha512 = options.bytes === String ? $util.base64.encode(message.sha512, 0, message.sha512.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha512) : message.sha512; - if (options.oneofs) - object.digest = "sha512"; - } - return object; - }; + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; - /** - * Converts this Digest to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.Digest - * @instance - * @returns {Object.} JSON object - */ - Digest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Digest; - })(); + return ServiceDescriptorProto; + })(); - v1.LocationMetadata = (function() { + protobuf.MethodDescriptorProto = (function() { - /** - * Properties of a LocationMetadata. - * @memberof google.cloud.kms.v1 - * @interface ILocationMetadata - * @property {boolean|null} [hsmAvailable] LocationMetadata hsmAvailable - */ + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ - /** - * Constructs a new LocationMetadata. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a LocationMetadata. - * @implements ILocationMetadata - * @constructor - * @param {google.cloud.kms.v1.ILocationMetadata=} [properties] Properties to set - */ - function LocationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * LocationMetadata hsmAvailable. - * @member {boolean} hsmAvailable - * @memberof google.cloud.kms.v1.LocationMetadata - * @instance - */ - LocationMetadata.prototype.hsmAvailable = false; + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; - /** - * Creates a new LocationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {google.cloud.kms.v1.ILocationMetadata=} [properties] Properties to set - * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata instance - */ - LocationMetadata.create = function create(properties) { - return new LocationMetadata(properties); - }; + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; - /** - * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {google.cloud.kms.v1.ILocationMetadata} message LocationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.hsmAvailable); - return writer; - }; - - /** - * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {google.cloud.kms.v1.ILocationMetadata} message LocationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.LocationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hsmAvailable = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; - /** - * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; - /** - * Verifies a LocationMetadata message. - * @function verify - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) - if (typeof message.hsmAvailable !== "boolean") - return "hsmAvailable: boolean expected"; - return null; - }; + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; - /** - * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata - */ - LocationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.LocationMetadata) - return object; - var message = new $root.google.cloud.kms.v1.LocationMetadata(); - if (object.hsmAvailable != null) - message.hsmAvailable = Boolean(object.hsmAvailable); - return message; - }; + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; - /** - * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.LocationMetadata - * @static - * @param {google.cloud.kms.v1.LocationMetadata} message LocationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hsmAvailable = false; - if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) - object.hsmAvailable = message.hsmAvailable; - return object; - }; + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; - /** - * Converts this LocationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.LocationMetadata - * @instance - * @returns {Object.} JSON object - */ - LocationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; - return LocationMetadata; - })(); + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1.KeyRing = (function() { + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a KeyRing. - * @memberof google.cloud.kms.v1 - * @interface IKeyRing - * @property {string|null} [name] KeyRing name - * @property {google.protobuf.ITimestamp|null} [createTime] KeyRing createTime - */ + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new KeyRing. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a KeyRing. - * @implements IKeyRing - * @constructor - * @param {google.cloud.kms.v1.IKeyRing=} [properties] Properties to set - */ - function KeyRing(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; - /** - * KeyRing name. - * @member {string} name - * @memberof google.cloud.kms.v1.KeyRing - * @instance - */ - KeyRing.prototype.name = ""; + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; - /** - * KeyRing createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.kms.v1.KeyRing - * @instance - */ - KeyRing.prototype.createTime = null; + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; - /** - * Creates a new KeyRing instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {google.cloud.kms.v1.IKeyRing=} [properties] Properties to set - * @returns {google.cloud.kms.v1.KeyRing} KeyRing instance - */ - KeyRing.create = function create(properties) { - return new KeyRing(properties); - }; + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified KeyRing message. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {google.cloud.kms.v1.IKeyRing} message KeyRing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + return MethodDescriptorProto; + })(); - /** - * Encodes the specified KeyRing message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {google.cloud.kms.v1.IKeyRing} message KeyRing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.FileOptions = (function() { - /** - * Decodes a KeyRing message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.KeyRing} KeyRing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRing.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyRing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ - /** - * Decodes a KeyRing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.KeyRing} KeyRing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a KeyRing message. - * @function verify - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - return null; - }; + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; - /** - * Creates a KeyRing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.KeyRing} KeyRing - */ - KeyRing.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.KeyRing) - return object; - var message = new $root.google.cloud.kms.v1.KeyRing(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.kms.v1.KeyRing.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; - /** - * Creates a plain object from a KeyRing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.KeyRing - * @static - * @param {google.cloud.kms.v1.KeyRing} message KeyRing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; - /** - * Converts this KeyRing to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.KeyRing - * @instance - * @returns {Object.} JSON object - */ - KeyRing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; - return KeyRing; - })(); + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; - v1.CryptoKey = (function() { + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; - /** - * Properties of a CryptoKey. - * @memberof google.cloud.kms.v1 - * @interface ICryptoKey - * @property {string|null} [name] CryptoKey name - * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [primary] CryptoKey primary - * @property {google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|null} [purpose] CryptoKey purpose - * @property {google.protobuf.ITimestamp|null} [createTime] CryptoKey createTime - * @property {google.protobuf.ITimestamp|null} [nextRotationTime] CryptoKey nextRotationTime - * @property {google.protobuf.IDuration|null} [rotationPeriod] CryptoKey rotationPeriod - * @property {google.cloud.kms.v1.ICryptoKeyVersionTemplate|null} [versionTemplate] CryptoKey versionTemplate - * @property {Object.|null} [labels] CryptoKey labels - */ + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; - /** - * Constructs a new CryptoKey. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CryptoKey. - * @implements ICryptoKey - * @constructor - * @param {google.cloud.kms.v1.ICryptoKey=} [properties] Properties to set - */ - function CryptoKey(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; - /** - * CryptoKey name. - * @member {string} name - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.name = ""; + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; - /** - * CryptoKey primary. - * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} primary - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.primary = null; + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; - /** - * CryptoKey purpose. - * @member {google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose} purpose - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.purpose = 0; + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; - /** - * CryptoKey createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.createTime = null; + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; - /** - * CryptoKey nextRotationTime. - * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.nextRotationTime = null; + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = false; - /** - * CryptoKey rotationPeriod. - * @member {google.protobuf.IDuration|null|undefined} rotationPeriod - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.rotationPeriod = null; + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; - /** - * CryptoKey versionTemplate. - * @member {google.cloud.kms.v1.ICryptoKeyVersionTemplate|null|undefined} versionTemplate - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.versionTemplate = null; + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; - /** - * CryptoKey labels. - * @member {Object.} labels - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - CryptoKey.prototype.labels = $util.emptyObject; + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; - /** - * CryptoKey rotationSchedule. - * @member {"rotationPeriod"|undefined} rotationSchedule - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - */ - Object.defineProperty(CryptoKey.prototype, "rotationSchedule", { - get: $util.oneOfGetter($oneOfFields = ["rotationPeriod"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; - /** - * Creates a new CryptoKey instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {google.cloud.kms.v1.ICryptoKey=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey instance - */ - CryptoKey.create = function create(properties) { - return new CryptoKey(properties); - }; + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; - /** - * Encodes the specified CryptoKey message. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {google.cloud.kms.v1.ICryptoKey} message CryptoKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.primary != null && message.hasOwnProperty("primary")) - $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.primary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.purpose != null && message.hasOwnProperty("purpose")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.purpose); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) - $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) - $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) - $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.encode(message.versionTemplate, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; - /** - * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {google.cloud.kms.v1.ICryptoKey} message CryptoKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a CryptoKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKey(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); - break; - case 3: - message.purpose = reader.int32(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 11: - message.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.decode(reader, reader.uint32()); - break; - case 10: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - /** - * Decodes a CryptoKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; - /** - * Verifies a CryptoKey message. - * @function verify - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CryptoKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.primary != null && message.hasOwnProperty("primary")) { - var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.primary); - if (error) - return "primary." + error; - } - if (message.purpose != null && message.hasOwnProperty("purpose")) - switch (message.purpose) { - default: - return "purpose: enum value expected"; - case 0: - case 1: - case 5: - case 6: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); - if (error) - return "nextRotationTime." + error; - } - if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { - properties.rotationSchedule = 1; - { - var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); - if (error) - return "rotationPeriod." + error; - } - } - if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) { - var error = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.verify(message.versionTemplate); - if (error) - return "versionTemplate." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a CryptoKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey - */ - CryptoKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CryptoKey) - return object; - var message = new $root.google.cloud.kms.v1.CryptoKey(); - if (object.name != null) - message.name = String(object.name); - if (object.primary != null) { - if (typeof object.primary !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.primary: object expected"); - message.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.primary); - } - switch (object.purpose) { - case "CRYPTO_KEY_PURPOSE_UNSPECIFIED": - case 0: - message.purpose = 0; - break; - case "ENCRYPT_DECRYPT": - case 1: - message.purpose = 1; - break; - case "ASYMMETRIC_SIGN": - case 5: - message.purpose = 5; - break; - case "ASYMMETRIC_DECRYPT": - case 6: - message.purpose = 6; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.nextRotationTime != null) { - if (typeof object.nextRotationTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.nextRotationTime: object expected"); - message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); - } - if (object.rotationPeriod != null) { - if (typeof object.rotationPeriod !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.rotationPeriod: object expected"); - message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); - } - if (object.versionTemplate != null) { - if (typeof object.versionTemplate !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.versionTemplate: object expected"); - message.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.fromObject(object.versionTemplate); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKey.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CryptoKey - * @static - * @param {google.cloud.kms.v1.CryptoKey} message CryptoKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CryptoKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.primary = null; - object.purpose = options.enums === String ? "CRYPTO_KEY_PURPOSE_UNSPECIFIED" : 0; - object.createTime = null; - object.nextRotationTime = null; - object.versionTemplate = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.primary != null && message.hasOwnProperty("primary")) - object.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.primary, options); - if (message.purpose != null && message.hasOwnProperty("purpose")) - object.purpose = options.enums === String ? $root.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose[message.purpose] : message.purpose; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) - object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); - if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { - object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); - if (options.oneofs) - object.rotationSchedule = "rotationPeriod"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) - object.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.toObject(message.versionTemplate, options); - return object; - }; + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; - /** - * Converts this CryptoKey to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CryptoKey - * @instance - * @returns {Object.} JSON object - */ - CryptoKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * CryptoKeyPurpose enum. - * @name google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose - * @enum {string} - * @property {number} CRYPTO_KEY_PURPOSE_UNSPECIFIED=0 CRYPTO_KEY_PURPOSE_UNSPECIFIED value - * @property {number} ENCRYPT_DECRYPT=1 ENCRYPT_DECRYPT value - * @property {number} ASYMMETRIC_SIGN=5 ASYMMETRIC_SIGN value - * @property {number} ASYMMETRIC_DECRYPT=6 ASYMMETRIC_DECRYPT value - */ - CryptoKey.CryptoKeyPurpose = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CRYPTO_KEY_PURPOSE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENCRYPT_DECRYPT"] = 1; - values[valuesById[5] = "ASYMMETRIC_SIGN"] = 5; - values[valuesById[6] = "ASYMMETRIC_DECRYPT"] = 6; - return values; - })(); - - return CryptoKey; - })(); - - v1.CryptoKeyVersionTemplate = (function() { - - /** - * Properties of a CryptoKeyVersionTemplate. - * @memberof google.cloud.kms.v1 - * @interface ICryptoKeyVersionTemplate - * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] CryptoKeyVersionTemplate protectionLevel - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] CryptoKeyVersionTemplate algorithm - */ - - /** - * Constructs a new CryptoKeyVersionTemplate. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CryptoKeyVersionTemplate. - * @implements ICryptoKeyVersionTemplate - * @constructor - * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate=} [properties] Properties to set - */ - function CryptoKeyVersionTemplate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * CryptoKeyVersionTemplate protectionLevel. - * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @instance - */ - CryptoKeyVersionTemplate.prototype.protectionLevel = 0; + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * CryptoKeyVersionTemplate algorithm. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @instance - */ - CryptoKeyVersionTemplate.prototype.algorithm = 0; + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; - /** - * Creates a new CryptoKeyVersionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate instance - */ - CryptoKeyVersionTemplate.create = function create(properties) { - return new CryptoKeyVersionTemplate(properties); - }; - - /** - * Encodes the specified CryptoKeyVersionTemplate message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate} message CryptoKeyVersionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKeyVersionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.protectionLevel); - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.algorithm); - return writer; - }; + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; - /** - * Encodes the specified CryptoKeyVersionTemplate message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate} message CryptoKeyVersionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKeyVersionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; - /** - * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKeyVersionTemplate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKeyVersionTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protectionLevel = reader.int32(); - break; - case 3: - message.algorithm = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKeyVersionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); - /** - * Verifies a CryptoKeyVersionTemplate message. - * @function verify - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CryptoKeyVersionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - switch (message.protectionLevel) { - default: - return "protectionLevel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 15: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 17: - case 12: - case 13: - break; - } - return null; - }; + return FileOptions; + })(); - /** - * Creates a CryptoKeyVersionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate - */ - CryptoKeyVersionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CryptoKeyVersionTemplate) - return object; - var message = new $root.google.cloud.kms.v1.CryptoKeyVersionTemplate(); - switch (object.protectionLevel) { - case "PROTECTION_LEVEL_UNSPECIFIED": - case 0: - message.protectionLevel = 0; - break; - case "SOFTWARE": - case 1: - message.protectionLevel = 1; - break; - case "HSM": - case 2: - message.protectionLevel = 2; - break; - case "EXTERNAL": - case 3: - message.protectionLevel = 3; - break; - } - switch (object.algorithm) { - case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "GOOGLE_SYMMETRIC_ENCRYPTION": - case 1: - message.algorithm = 1; - break; - case "RSA_SIGN_PSS_2048_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_SIGN_PSS_3072_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_SIGN_PSS_4096_SHA256": - case 4: - message.algorithm = 4; - break; - case "RSA_SIGN_PSS_4096_SHA512": - case 15: - message.algorithm = 15; - break; - case "RSA_SIGN_PKCS1_2048_SHA256": - case 5: - message.algorithm = 5; - break; - case "RSA_SIGN_PKCS1_3072_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_SIGN_PKCS1_4096_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_SIGN_PKCS1_4096_SHA512": - case 16: - message.algorithm = 16; - break; - case "RSA_DECRYPT_OAEP_2048_SHA256": - case 8: - message.algorithm = 8; - break; - case "RSA_DECRYPT_OAEP_3072_SHA256": - case 9: - message.algorithm = 9; - break; - case "RSA_DECRYPT_OAEP_4096_SHA256": - case 10: - message.algorithm = 10; - break; - case "RSA_DECRYPT_OAEP_4096_SHA512": - case 17: - message.algorithm = 17; - break; - case "EC_SIGN_P256_SHA256": - case 12: - message.algorithm = 12; - break; - case "EC_SIGN_P384_SHA384": - case 13: - message.algorithm = 13; - break; - } - return message; - }; + protobuf.MessageOptions = (function() { - /** - * Creates a plain object from a CryptoKeyVersionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @static - * @param {google.cloud.kms.v1.CryptoKeyVersionTemplate} message CryptoKeyVersionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CryptoKeyVersionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; - object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; - } - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; - return object; - }; + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ - /** - * Converts this CryptoKeyVersionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate - * @instance - * @returns {Object.} JSON object - */ - CryptoKeyVersionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return CryptoKeyVersionTemplate; - })(); + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; - v1.KeyOperationAttestation = (function() { + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; - /** - * Properties of a KeyOperationAttestation. - * @memberof google.cloud.kms.v1 - * @interface IKeyOperationAttestation - * @property {google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|null} [format] KeyOperationAttestation format - * @property {Uint8Array|null} [content] KeyOperationAttestation content - */ + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; - /** - * Constructs a new KeyOperationAttestation. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a KeyOperationAttestation. - * @implements IKeyOperationAttestation - * @constructor - * @param {google.cloud.kms.v1.IKeyOperationAttestation=} [properties] Properties to set - */ - function KeyOperationAttestation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; - /** - * KeyOperationAttestation format. - * @member {google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat} format - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @instance - */ - KeyOperationAttestation.prototype.format = 0; + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * KeyOperationAttestation content. - * @member {Uint8Array} content - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @instance - */ - KeyOperationAttestation.prototype.content = $util.newBuffer([]); + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; - /** - * Creates a new KeyOperationAttestation instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {google.cloud.kms.v1.IKeyOperationAttestation=} [properties] Properties to set - * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation instance - */ - KeyOperationAttestation.create = function create(properties) { - return new KeyOperationAttestation(properties); - }; + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; - /** - * Encodes the specified KeyOperationAttestation message. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {google.cloud.kms.v1.IKeyOperationAttestation} message KeyOperationAttestation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyOperationAttestation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && message.hasOwnProperty("format")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.format); - if (message.content != null && message.hasOwnProperty("content")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.content); - return writer; - }; + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified KeyOperationAttestation message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {google.cloud.kms.v1.IKeyOperationAttestation} message KeyOperationAttestation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyOperationAttestation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a KeyOperationAttestation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyOperationAttestation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyOperationAttestation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.format = reader.int32(); - break; - case 5: - message.content = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a KeyOperationAttestation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyOperationAttestation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a KeyOperationAttestation message. - * @function verify - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyOperationAttestation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 3: - case 4: - break; - } - if (message.content != null && message.hasOwnProperty("content")) - if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) - return "content: buffer expected"; - return null; - }; + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; - /** - * Creates a KeyOperationAttestation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation - */ - KeyOperationAttestation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.KeyOperationAttestation) - return object; - var message = new $root.google.cloud.kms.v1.KeyOperationAttestation(); - switch (object.format) { - case "ATTESTATION_FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "CAVIUM_V1_COMPRESSED": - case 3: - message.format = 3; - break; - case "CAVIUM_V2_COMPRESSED": - case 4: - message.format = 4; - break; - } - if (object.content != null) - if (typeof object.content === "string") - $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); - else if (object.content.length) - message.content = object.content; - return message; - }; + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; - /** - * Creates a plain object from a KeyOperationAttestation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @static - * @param {google.cloud.kms.v1.KeyOperationAttestation} message KeyOperationAttestation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyOperationAttestation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.format = options.enums === String ? "ATTESTATION_FORMAT_UNSPECIFIED" : 0; - if (options.bytes === String) - object.content = ""; - else { - object.content = []; - if (options.bytes !== Array) - object.content = $util.newBuffer(object.content); - } - } - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat[message.format] : message.format; - if (message.content != null && message.hasOwnProperty("content")) - object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; - return object; - }; + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; - /** - * Converts this KeyOperationAttestation to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.KeyOperationAttestation - * @instance - * @returns {Object.} JSON object - */ - KeyOperationAttestation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * AttestationFormat enum. - * @name google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat - * @enum {string} - * @property {number} ATTESTATION_FORMAT_UNSPECIFIED=0 ATTESTATION_FORMAT_UNSPECIFIED value - * @property {number} CAVIUM_V1_COMPRESSED=3 CAVIUM_V1_COMPRESSED value - * @property {number} CAVIUM_V2_COMPRESSED=4 CAVIUM_V2_COMPRESSED value - */ - KeyOperationAttestation.AttestationFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTESTATION_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[3] = "CAVIUM_V1_COMPRESSED"] = 3; - values[valuesById[4] = "CAVIUM_V2_COMPRESSED"] = 4; - return values; - })(); + return MessageOptions; + })(); - return KeyOperationAttestation; - })(); + protobuf.FieldOptions = (function() { - v1.CryptoKeyVersion = (function() { + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ - /** - * Properties of a CryptoKeyVersion. - * @memberof google.cloud.kms.v1 - * @interface ICryptoKeyVersion - * @property {string|null} [name] CryptoKeyVersion name - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|null} [state] CryptoKeyVersion state - * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] CryptoKeyVersion protectionLevel - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] CryptoKeyVersion algorithm - * @property {google.cloud.kms.v1.IKeyOperationAttestation|null} [attestation] CryptoKeyVersion attestation - * @property {google.protobuf.ITimestamp|null} [createTime] CryptoKeyVersion createTime - * @property {google.protobuf.ITimestamp|null} [generateTime] CryptoKeyVersion generateTime - * @property {google.protobuf.ITimestamp|null} [destroyTime] CryptoKeyVersion destroyTime - * @property {google.protobuf.ITimestamp|null} [destroyEventTime] CryptoKeyVersion destroyEventTime - * @property {string|null} [importJob] CryptoKeyVersion importJob - * @property {google.protobuf.ITimestamp|null} [importTime] CryptoKeyVersion importTime - * @property {string|null} [importFailureReason] CryptoKeyVersion importFailureReason - */ - - /** - * Constructs a new CryptoKeyVersion. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a CryptoKeyVersion. - * @implements ICryptoKeyVersion - * @constructor - * @param {google.cloud.kms.v1.ICryptoKeyVersion=} [properties] Properties to set - */ - function CryptoKeyVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CryptoKeyVersion name. - * @member {string} name - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.name = ""; + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; - /** - * CryptoKeyVersion state. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState} state - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.state = 0; + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; - /** - * CryptoKeyVersion protectionLevel. - * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.protectionLevel = 0; + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; - /** - * CryptoKeyVersion algorithm. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.algorithm = 0; + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; - /** - * CryptoKeyVersion attestation. - * @member {google.cloud.kms.v1.IKeyOperationAttestation|null|undefined} attestation - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.attestation = null; + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; - /** - * CryptoKeyVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.createTime = null; + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; - /** - * CryptoKeyVersion generateTime. - * @member {google.protobuf.ITimestamp|null|undefined} generateTime - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.generateTime = null; + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * CryptoKeyVersion destroyTime. - * @member {google.protobuf.ITimestamp|null|undefined} destroyTime - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.destroyTime = null; + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - /** - * CryptoKeyVersion destroyEventTime. - * @member {google.protobuf.ITimestamp|null|undefined} destroyEventTime - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.destroyEventTime = null; + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; - /** - * CryptoKeyVersion importJob. - * @member {string} importJob - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.importJob = ""; + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; - /** - * CryptoKeyVersion importTime. - * @member {google.protobuf.ITimestamp|null|undefined} importTime - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.importTime = null; + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; - /** - * CryptoKeyVersion importFailureReason. - * @member {string} importFailureReason - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - */ - CryptoKeyVersion.prototype.importFailureReason = ""; + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new CryptoKeyVersion instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersion=} [properties] Properties to set - * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion instance - */ - CryptoKeyVersion.create = function create(properties) { - return new CryptoKeyVersion(properties); - }; + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified CryptoKeyVersion message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersion} message CryptoKeyVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKeyVersion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) - $root.google.protobuf.Timestamp.encode(message.destroyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) - $root.google.protobuf.Timestamp.encode(message.destroyEventTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.protectionLevel); - if (message.attestation != null && message.hasOwnProperty("attestation")) - $root.google.cloud.kms.v1.KeyOperationAttestation.encode(message.attestation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.algorithm); - if (message.generateTime != null && message.hasOwnProperty("generateTime")) - $root.google.protobuf.Timestamp.encode(message.generateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.importJob != null && message.hasOwnProperty("importJob")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.importJob); - if (message.importTime != null && message.hasOwnProperty("importTime")) - $root.google.protobuf.Timestamp.encode(message.importTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.importFailureReason); - return writer; - }; + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified CryptoKeyVersion message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {google.cloud.kms.v1.ICryptoKeyVersion} message CryptoKeyVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CryptoKeyVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; - /** - * Decodes a CryptoKeyVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKeyVersion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKeyVersion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.state = reader.int32(); - break; - case 7: - message.protectionLevel = reader.int32(); - break; - case 10: - message.algorithm = reader.int32(); - break; - case 8: - message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.decode(reader, reader.uint32()); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.generateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.destroyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.destroyEventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 14: - message.importJob = reader.string(); - break; - case 15: - message.importTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 16: - message.importFailureReason = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CryptoKeyVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CryptoKeyVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CryptoKeyVersion message. - * @function verify - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CryptoKeyVersion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 5: - case 1: - case 2: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - switch (message.protectionLevel) { - default: - return "protectionLevel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 15: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 17: - case 12: - case 13: - break; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.google.cloud.kms.v1.KeyOperationAttestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.generateTime != null && message.hasOwnProperty("generateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.generateTime); - if (error) - return "generateTime." + error; - } - if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.destroyTime); - if (error) - return "destroyTime." + error; - } - if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.destroyEventTime); - if (error) - return "destroyEventTime." + error; - } - if (message.importJob != null && message.hasOwnProperty("importJob")) - if (!$util.isString(message.importJob)) - return "importJob: string expected"; - if (message.importTime != null && message.hasOwnProperty("importTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.importTime); - if (error) - return "importTime." + error; - } - if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) - if (!$util.isString(message.importFailureReason)) - return "importFailureReason: string expected"; - return null; - }; - - /** - * Creates a CryptoKeyVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion - */ - CryptoKeyVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.CryptoKeyVersion) - return object; - var message = new $root.google.cloud.kms.v1.CryptoKeyVersion(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED": + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: - message.state = 0; - break; - case "PENDING_GENERATION": - case 5: - message.state = 5; + message[".google.api.fieldBehavior"][i] = 0; break; - case "ENABLED": + case "OPTIONAL": case 1: - message.state = 1; + message[".google.api.fieldBehavior"][i] = 1; break; - case "DISABLED": + case "REQUIRED": case 2: - message.state = 2; + message[".google.api.fieldBehavior"][i] = 2; break; - case "DESTROYED": + case "OUTPUT_ONLY": case 3: - message.state = 3; + message[".google.api.fieldBehavior"][i] = 3; break; - case "DESTROY_SCHEDULED": + case "INPUT_ONLY": case 4: - message.state = 4; - break; - case "PENDING_IMPORT": - case 6: - message.state = 6; + message[".google.api.fieldBehavior"][i] = 4; break; - case "IMPORT_FAILED": - case 7: - message.state = 7; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; break; } - switch (object.protectionLevel) { - case "PROTECTION_LEVEL_UNSPECIFIED": - case 0: - message.protectionLevel = 0; - break; - case "SOFTWARE": - case 1: - message.protectionLevel = 1; - break; - case "HSM": - case 2: - message.protectionLevel = 2; - break; - case "EXTERNAL": - case 3: - message.protectionLevel = 3; - break; - } - switch (object.algorithm) { - case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "GOOGLE_SYMMETRIC_ENCRYPTION": - case 1: - message.algorithm = 1; - break; - case "RSA_SIGN_PSS_2048_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_SIGN_PSS_3072_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_SIGN_PSS_4096_SHA256": - case 4: - message.algorithm = 4; - break; - case "RSA_SIGN_PSS_4096_SHA512": - case 15: - message.algorithm = 15; - break; - case "RSA_SIGN_PKCS1_2048_SHA256": - case 5: - message.algorithm = 5; - break; - case "RSA_SIGN_PKCS1_3072_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_SIGN_PKCS1_4096_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_SIGN_PKCS1_4096_SHA512": - case 16: - message.algorithm = 16; - break; - case "RSA_DECRYPT_OAEP_2048_SHA256": - case 8: - message.algorithm = 8; - break; - case "RSA_DECRYPT_OAEP_3072_SHA256": - case 9: - message.algorithm = 9; - break; - case "RSA_DECRYPT_OAEP_4096_SHA256": - case 10: - message.algorithm = 10; - break; - case "RSA_DECRYPT_OAEP_4096_SHA512": - case 17: - message.algorithm = 17; - break; - case "EC_SIGN_P256_SHA256": - case 12: - message.algorithm = 12; - break; - case "EC_SIGN_P384_SHA384": - case 13: - message.algorithm = 13; - break; - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.attestation: object expected"); - message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.fromObject(object.attestation); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.generateTime != null) { - if (typeof object.generateTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.generateTime: object expected"); - message.generateTime = $root.google.protobuf.Timestamp.fromObject(object.generateTime); - } - if (object.destroyTime != null) { - if (typeof object.destroyTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.destroyTime: object expected"); - message.destroyTime = $root.google.protobuf.Timestamp.fromObject(object.destroyTime); - } - if (object.destroyEventTime != null) { - if (typeof object.destroyEventTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.destroyEventTime: object expected"); - message.destroyEventTime = $root.google.protobuf.Timestamp.fromObject(object.destroyEventTime); - } - if (object.importJob != null) - message.importJob = String(object.importJob); - if (object.importTime != null) { - if (typeof object.importTime !== "object") - throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.importTime: object expected"); - message.importTime = $root.google.protobuf.Timestamp.fromObject(object.importTime); - } - if (object.importFailureReason != null) - message.importFailureReason = String(object.importFailureReason); - return message; - }; + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; - /** - * Creates a plain object from a CryptoKeyVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @static - * @param {google.cloud.kms.v1.CryptoKeyVersion} message CryptoKeyVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CryptoKeyVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.destroyTime = null; - object.destroyEventTime = null; - object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; - object.attestation = null; - object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; - object.generateTime = null; - object.importJob = ""; - object.importTime = null; - object.importFailureReason = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) - object.destroyTime = $root.google.protobuf.Timestamp.toObject(message.destroyTime, options); - if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) - object.destroyEventTime = $root.google.protobuf.Timestamp.toObject(message.destroyEventTime, options); - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; - if (message.generateTime != null && message.hasOwnProperty("generateTime")) - object.generateTime = $root.google.protobuf.Timestamp.toObject(message.generateTime, options); - if (message.importJob != null && message.hasOwnProperty("importJob")) - object.importJob = message.importJob; - if (message.importTime != null && message.hasOwnProperty("importTime")) - object.importTime = $root.google.protobuf.Timestamp.toObject(message.importTime, options); - if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) - object.importFailureReason = message.importFailureReason; - return object; - }; + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; - /** - * Converts this CryptoKeyVersion to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.CryptoKeyVersion - * @instance - * @returns {Object.} JSON object - */ - CryptoKeyVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * CryptoKeyVersionAlgorithm enum. - * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm - * @enum {string} - * @property {number} CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED=0 CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED value - * @property {number} GOOGLE_SYMMETRIC_ENCRYPTION=1 GOOGLE_SYMMETRIC_ENCRYPTION value - * @property {number} RSA_SIGN_PSS_2048_SHA256=2 RSA_SIGN_PSS_2048_SHA256 value - * @property {number} RSA_SIGN_PSS_3072_SHA256=3 RSA_SIGN_PSS_3072_SHA256 value - * @property {number} RSA_SIGN_PSS_4096_SHA256=4 RSA_SIGN_PSS_4096_SHA256 value - * @property {number} RSA_SIGN_PSS_4096_SHA512=15 RSA_SIGN_PSS_4096_SHA512 value - * @property {number} RSA_SIGN_PKCS1_2048_SHA256=5 RSA_SIGN_PKCS1_2048_SHA256 value - * @property {number} RSA_SIGN_PKCS1_3072_SHA256=6 RSA_SIGN_PKCS1_3072_SHA256 value - * @property {number} RSA_SIGN_PKCS1_4096_SHA256=7 RSA_SIGN_PKCS1_4096_SHA256 value - * @property {number} RSA_SIGN_PKCS1_4096_SHA512=16 RSA_SIGN_PKCS1_4096_SHA512 value - * @property {number} RSA_DECRYPT_OAEP_2048_SHA256=8 RSA_DECRYPT_OAEP_2048_SHA256 value - * @property {number} RSA_DECRYPT_OAEP_3072_SHA256=9 RSA_DECRYPT_OAEP_3072_SHA256 value - * @property {number} RSA_DECRYPT_OAEP_4096_SHA256=10 RSA_DECRYPT_OAEP_4096_SHA256 value - * @property {number} RSA_DECRYPT_OAEP_4096_SHA512=17 RSA_DECRYPT_OAEP_4096_SHA512 value - * @property {number} EC_SIGN_P256_SHA256=12 EC_SIGN_P256_SHA256 value - * @property {number} EC_SIGN_P384_SHA384=13 EC_SIGN_P384_SHA384 value - */ - CryptoKeyVersion.CryptoKeyVersionAlgorithm = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_SYMMETRIC_ENCRYPTION"] = 1; - values[valuesById[2] = "RSA_SIGN_PSS_2048_SHA256"] = 2; - values[valuesById[3] = "RSA_SIGN_PSS_3072_SHA256"] = 3; - values[valuesById[4] = "RSA_SIGN_PSS_4096_SHA256"] = 4; - values[valuesById[15] = "RSA_SIGN_PSS_4096_SHA512"] = 15; - values[valuesById[5] = "RSA_SIGN_PKCS1_2048_SHA256"] = 5; - values[valuesById[6] = "RSA_SIGN_PKCS1_3072_SHA256"] = 6; - values[valuesById[7] = "RSA_SIGN_PKCS1_4096_SHA256"] = 7; - values[valuesById[16] = "RSA_SIGN_PKCS1_4096_SHA512"] = 16; - values[valuesById[8] = "RSA_DECRYPT_OAEP_2048_SHA256"] = 8; - values[valuesById[9] = "RSA_DECRYPT_OAEP_3072_SHA256"] = 9; - values[valuesById[10] = "RSA_DECRYPT_OAEP_4096_SHA256"] = 10; - values[valuesById[17] = "RSA_DECRYPT_OAEP_4096_SHA512"] = 17; - values[valuesById[12] = "EC_SIGN_P256_SHA256"] = 12; - values[valuesById[13] = "EC_SIGN_P384_SHA384"] = 13; - return values; - })(); - - /** - * CryptoKeyVersionState enum. - * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState - * @enum {string} - * @property {number} CRYPTO_KEY_VERSION_STATE_UNSPECIFIED=0 CRYPTO_KEY_VERSION_STATE_UNSPECIFIED value - * @property {number} PENDING_GENERATION=5 PENDING_GENERATION value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} DESTROYED=3 DESTROYED value - * @property {number} DESTROY_SCHEDULED=4 DESTROY_SCHEDULED value - * @property {number} PENDING_IMPORT=6 PENDING_IMPORT value - * @property {number} IMPORT_FAILED=7 IMPORT_FAILED value - */ - CryptoKeyVersion.CryptoKeyVersionState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED"] = 0; - values[valuesById[5] = "PENDING_GENERATION"] = 5; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "DESTROYED"] = 3; - values[valuesById[4] = "DESTROY_SCHEDULED"] = 4; - values[valuesById[6] = "PENDING_IMPORT"] = 6; - values[valuesById[7] = "IMPORT_FAILED"] = 7; - return values; - })(); - - /** - * CryptoKeyVersionView enum. - * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView - * @enum {string} - * @property {number} CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED=0 CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED value - * @property {number} FULL=1 FULL value - */ - CryptoKeyVersion.CryptoKeyVersionView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL"] = 1; - return values; - })(); + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); - return CryptoKeyVersion; - })(); + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); - v1.PublicKey = (function() { + return FieldOptions; + })(); - /** - * Properties of a PublicKey. - * @memberof google.cloud.kms.v1 - * @interface IPublicKey - * @property {string|null} [pem] PublicKey pem - * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] PublicKey algorithm - */ + protobuf.OneofOptions = (function() { - /** - * Constructs a new PublicKey. - * @memberof google.cloud.kms.v1 - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {google.cloud.kms.v1.IPublicKey=} [properties] Properties to set - */ - function PublicKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ - /** - * PublicKey pem. - * @member {string} pem - * @memberof google.cloud.kms.v1.PublicKey - * @instance - */ - PublicKey.prototype.pem = ""; + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * PublicKey algorithm. - * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm - * @memberof google.cloud.kms.v1.PublicKey - * @instance - */ - PublicKey.prototype.algorithm = 0; + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a new PublicKey instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {google.cloud.kms.v1.IPublicKey=} [properties] Properties to set - * @returns {google.cloud.kms.v1.PublicKey} PublicKey instance - */ - PublicKey.create = function create(properties) { - return new PublicKey(properties); - }; + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {google.cloud.kms.v1.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pem != null && message.hasOwnProperty("pem")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pem); - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); - return writer; - }; + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {google.cloud.kms.v1.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.PublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pem = reader.string(); - break; - case 2: - message.algorithm = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a PublicKey message. - * @function verify - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublicKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pem != null && message.hasOwnProperty("pem")) - if (!$util.isString(message.pem)) - return "pem: string expected"; - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 15: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 17: - case 12: - case 13: - break; - } - return null; - }; + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.PublicKey) - return object; - var message = new $root.google.cloud.kms.v1.PublicKey(); - if (object.pem != null) - message.pem = String(object.pem); - switch (object.algorithm) { - case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "GOOGLE_SYMMETRIC_ENCRYPTION": - case 1: - message.algorithm = 1; - break; - case "RSA_SIGN_PSS_2048_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_SIGN_PSS_3072_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_SIGN_PSS_4096_SHA256": - case 4: - message.algorithm = 4; - break; - case "RSA_SIGN_PSS_4096_SHA512": - case 15: - message.algorithm = 15; - break; - case "RSA_SIGN_PKCS1_2048_SHA256": - case 5: - message.algorithm = 5; - break; - case "RSA_SIGN_PKCS1_3072_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_SIGN_PKCS1_4096_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_SIGN_PKCS1_4096_SHA512": - case 16: - message.algorithm = 16; - break; - case "RSA_DECRYPT_OAEP_2048_SHA256": - case 8: - message.algorithm = 8; - break; - case "RSA_DECRYPT_OAEP_3072_SHA256": - case 9: - message.algorithm = 9; - break; - case "RSA_DECRYPT_OAEP_4096_SHA256": - case 10: - message.algorithm = 10; - break; - case "RSA_DECRYPT_OAEP_4096_SHA512": - case 17: - message.algorithm = 17; - break; - case "EC_SIGN_P256_SHA256": - case 12: - message.algorithm = 12; - break; - case "EC_SIGN_P384_SHA384": - case 13: - message.algorithm = 13; - break; - } - return message; - }; + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.PublicKey - * @static - * @param {google.cloud.kms.v1.PublicKey} message PublicKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublicKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pem = ""; - object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; - } - if (message.pem != null && message.hasOwnProperty("pem")) - object.pem = message.pem; - if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PublicKey; - })(); - - v1.ImportJob = (function() { - - /** - * Properties of an ImportJob. - * @memberof google.cloud.kms.v1 - * @interface IImportJob - * @property {string|null} [name] ImportJob name - * @property {google.cloud.kms.v1.ImportJob.ImportMethod|null} [importMethod] ImportJob importMethod - * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] ImportJob protectionLevel - * @property {google.protobuf.ITimestamp|null} [createTime] ImportJob createTime - * @property {google.protobuf.ITimestamp|null} [generateTime] ImportJob generateTime - * @property {google.protobuf.ITimestamp|null} [expireTime] ImportJob expireTime - * @property {google.protobuf.ITimestamp|null} [expireEventTime] ImportJob expireEventTime - * @property {google.cloud.kms.v1.ImportJob.ImportJobState|null} [state] ImportJob state - * @property {google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null} [publicKey] ImportJob publicKey - * @property {google.cloud.kms.v1.IKeyOperationAttestation|null} [attestation] ImportJob attestation - */ + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Constructs a new ImportJob. - * @memberof google.cloud.kms.v1 - * @classdesc Represents an ImportJob. - * @implements IImportJob - * @constructor - * @param {google.cloud.kms.v1.IImportJob=} [properties] Properties to set - */ - function ImportJob(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ImportJob name. - * @member {string} name - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.name = ""; + return OneofOptions; + })(); - /** - * ImportJob importMethod. - * @member {google.cloud.kms.v1.ImportJob.ImportMethod} importMethod - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.importMethod = 0; + protobuf.EnumOptions = (function() { - /** - * ImportJob protectionLevel. - * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.protectionLevel = 0; + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ - /** - * ImportJob createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.createTime = null; + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ImportJob generateTime. - * @member {google.protobuf.ITimestamp|null|undefined} generateTime - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.generateTime = null; + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; - /** - * ImportJob expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.expireTime = null; + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; - /** - * ImportJob expireEventTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireEventTime - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.expireEventTime = null; + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * ImportJob state. - * @member {google.cloud.kms.v1.ImportJob.ImportJobState} state - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.state = 0; + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; - /** - * ImportJob publicKey. - * @member {google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null|undefined} publicKey - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.publicKey = null; + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * ImportJob attestation. - * @member {google.cloud.kms.v1.IKeyOperationAttestation|null|undefined} attestation - * @memberof google.cloud.kms.v1.ImportJob - * @instance - */ - ImportJob.prototype.attestation = null; + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ImportJob instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {google.cloud.kms.v1.IImportJob=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ImportJob} ImportJob instance - */ - ImportJob.create = function create(properties) { - return new ImportJob(properties); - }; - - /** - * Encodes the specified ImportJob message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {google.cloud.kms.v1.IImportJob} message ImportJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.importMethod != null && message.hasOwnProperty("importMethod")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.importMethod); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.generateTime != null && message.hasOwnProperty("generateTime")) - $root.google.protobuf.Timestamp.encode(message.generateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.encode(message.publicKey, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.attestation != null && message.hasOwnProperty("attestation")) - $root.google.cloud.kms.v1.KeyOperationAttestation.encode(message.attestation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.protectionLevel); - if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) - $root.google.protobuf.Timestamp.encode(message.expireEventTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ImportJob message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {google.cloud.kms.v1.IImportJob} message ImportJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an ImportJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ImportJob} ImportJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportJob.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportJob(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.importMethod = reader.int32(); - break; - case 9: - message.protectionLevel = reader.int32(); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.generateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.expireEventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.state = reader.int32(); - break; - case 7: - message.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.decode(reader, reader.uint32()); - break; - case 8: - message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Decodes an ImportJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ImportJob} ImportJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Verifies an ImportJob message. - * @function verify - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.importMethod != null && message.hasOwnProperty("importMethod")) - switch (message.importMethod) { - default: - return "importMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - switch (message.protectionLevel) { - default: - return "protectionLevel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.generateTime != null && message.hasOwnProperty("generateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.generateTime); - if (error) - return "generateTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireEventTime); - if (error) - return "expireEventTime." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.google.cloud.kms.v1.KeyOperationAttestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - return null; - }; + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Creates an ImportJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ImportJob} ImportJob - */ - ImportJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ImportJob) - return object; - var message = new $root.google.cloud.kms.v1.ImportJob(); - if (object.name != null) - message.name = String(object.name); - switch (object.importMethod) { - case "IMPORT_METHOD_UNSPECIFIED": - case 0: - message.importMethod = 0; - break; - case "RSA_OAEP_3072_SHA1_AES_256": - case 1: - message.importMethod = 1; - break; - case "RSA_OAEP_4096_SHA1_AES_256": - case 2: - message.importMethod = 2; - break; - } - switch (object.protectionLevel) { - case "PROTECTION_LEVEL_UNSPECIFIED": - case 0: - message.protectionLevel = 0; - break; - case "SOFTWARE": - case 1: - message.protectionLevel = 1; - break; - case "HSM": - case 2: - message.protectionLevel = 2; - break; - case "EXTERNAL": - case 3: - message.protectionLevel = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.generateTime != null) { - if (typeof object.generateTime !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.generateTime: object expected"); - message.generateTime = $root.google.protobuf.Timestamp.fromObject(object.generateTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.expireEventTime != null) { - if (typeof object.expireEventTime !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.expireEventTime: object expected"); - message.expireEventTime = $root.google.protobuf.Timestamp.fromObject(object.expireEventTime); - } - switch (object.state) { - case "IMPORT_JOB_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING_GENERATION": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "EXPIRED": - case 3: - message.state = 3; - break; - } - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.publicKey: object expected"); - message.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.fromObject(object.publicKey); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".google.cloud.kms.v1.ImportJob.attestation: object expected"); - message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.fromObject(object.attestation); - } - return message; - }; + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from an ImportJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ImportJob - * @static - * @param {google.cloud.kms.v1.ImportJob} message ImportJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.importMethod = options.enums === String ? "IMPORT_METHOD_UNSPECIFIED" : 0; - object.createTime = null; - object.generateTime = null; - object.expireTime = null; - object.state = options.enums === String ? "IMPORT_JOB_STATE_UNSPECIFIED" : 0; - object.publicKey = null; - object.attestation = null; - object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; - object.expireEventTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.importMethod != null && message.hasOwnProperty("importMethod")) - object.importMethod = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportMethod[message.importMethod] : message.importMethod; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.generateTime != null && message.hasOwnProperty("generateTime")) - object.generateTime = $root.google.protobuf.Timestamp.toObject(message.generateTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportJobState[message.state] : message.state; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.toObject(message.publicKey, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); - if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; - if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) - object.expireEventTime = $root.google.protobuf.Timestamp.toObject(message.expireEventTime, options); - return object; - }; + return EnumOptions; + })(); - /** - * Converts this ImportJob to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ImportJob - * @instance - * @returns {Object.} JSON object - */ - ImportJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + protobuf.EnumValueOptions = (function() { - ImportJob.WrappingPublicKey = (function() { + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ - /** - * Properties of a WrappingPublicKey. - * @memberof google.cloud.kms.v1.ImportJob - * @interface IWrappingPublicKey - * @property {string|null} [pem] WrappingPublicKey pem - */ - - /** - * Constructs a new WrappingPublicKey. - * @memberof google.cloud.kms.v1.ImportJob - * @classdesc Represents a WrappingPublicKey. - * @implements IWrappingPublicKey - * @constructor - * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey=} [properties] Properties to set - */ - function WrappingPublicKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * WrappingPublicKey pem. - * @member {string} pem - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @instance - */ - WrappingPublicKey.prototype.pem = ""; + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; - /** - * Creates a new WrappingPublicKey instance using the specified properties. - * @function create - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey=} [properties] Properties to set - * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey instance - */ - WrappingPublicKey.create = function create(properties) { - return new WrappingPublicKey(properties); - }; + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Encodes the specified WrappingPublicKey message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey} message WrappingPublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WrappingPublicKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pem != null && message.hasOwnProperty("pem")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pem); - return writer; - }; + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; - /** - * Encodes the specified WrappingPublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey} message WrappingPublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WrappingPublicKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Decodes a WrappingPublicKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WrappingPublicKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pem = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a WrappingPublicKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WrappingPublicKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a WrappingPublicKey message. - * @function verify - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WrappingPublicKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pem != null && message.hasOwnProperty("pem")) - if (!$util.isString(message.pem)) - return "pem: string expected"; - return null; - }; + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a WrappingPublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey - */ - WrappingPublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey) - return object; - var message = new $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey(); - if (object.pem != null) - message.pem = String(object.pem); - return message; - }; - - /** - * Creates a plain object from a WrappingPublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @static - * @param {google.cloud.kms.v1.ImportJob.WrappingPublicKey} message WrappingPublicKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WrappingPublicKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pem = ""; - if (message.pem != null && message.hasOwnProperty("pem")) - object.pem = message.pem; - return object; - }; - - /** - * Converts this WrappingPublicKey to JSON. - * @function toJSON - * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey - * @instance - * @returns {Object.} JSON object - */ - WrappingPublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WrappingPublicKey; - })(); - - /** - * ImportMethod enum. - * @name google.cloud.kms.v1.ImportJob.ImportMethod - * @enum {string} - * @property {number} IMPORT_METHOD_UNSPECIFIED=0 IMPORT_METHOD_UNSPECIFIED value - * @property {number} RSA_OAEP_3072_SHA1_AES_256=1 RSA_OAEP_3072_SHA1_AES_256 value - * @property {number} RSA_OAEP_4096_SHA1_AES_256=2 RSA_OAEP_4096_SHA1_AES_256 value - */ - ImportJob.ImportMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMPORT_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "RSA_OAEP_3072_SHA1_AES_256"] = 1; - values[valuesById[2] = "RSA_OAEP_4096_SHA1_AES_256"] = 2; - return values; - })(); - - /** - * ImportJobState enum. - * @name google.cloud.kms.v1.ImportJob.ImportJobState - * @enum {string} - * @property {number} IMPORT_JOB_STATE_UNSPECIFIED=0 IMPORT_JOB_STATE_UNSPECIFIED value - * @property {number} PENDING_GENERATION=1 PENDING_GENERATION value - * @property {number} ACTIVE=2 ACTIVE value - * @property {number} EXPIRED=3 EXPIRED value - */ - ImportJob.ImportJobState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMPORT_JOB_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_GENERATION"] = 1; - values[valuesById[2] = "ACTIVE"] = 2; - values[valuesById[3] = "EXPIRED"] = 3; - return values; - })(); + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - return ImportJob; - })(); + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * ProtectionLevel enum. - * @name google.cloud.kms.v1.ProtectionLevel - * @enum {string} - * @property {number} PROTECTION_LEVEL_UNSPECIFIED=0 PROTECTION_LEVEL_UNSPECIFIED value - * @property {number} SOFTWARE=1 SOFTWARE value - * @property {number} HSM=2 HSM value - * @property {number} EXTERNAL=3 EXTERNAL value - */ - v1.ProtectionLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROTECTION_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "SOFTWARE"] = 1; - values[valuesById[2] = "HSM"] = 2; - values[valuesById[3] = "EXTERNAL"] = 3; - return values; - })(); + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - return v1; - })(); + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return kms; + return EnumValueOptions; })(); - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function ServiceOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11496,91 +10995,117 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions * @instance */ - Http.prototype.rules = $util.emptyArray; + ServiceOptions.prototype.deprecated = false; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance */ - Http.create = function create(properties) { - return new Http(properties); - }; + ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 33: + message.deprecated = reader.bool(); break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); @@ -11591,143 +11116,156 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "rules." + error; + return "uninterpretedOption." + error; } } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.api.Http} message Http + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** - * Converts this Http to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return ServiceOptions; })(); - api.HttpRule = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11735,209 +11273,133 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions * @instance */ - HttpRule.prototype.selector = ""; + MethodOptions.prototype.deprecated = false; /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions * @instance */ - HttpRule.prototype.get = ""; + MethodOptions.prototype.idempotencyLevel = 0; /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions * @instance */ - HttpRule.prototype.put = ""; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; - - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = ""; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + MethodOptions.prototype[".google.api.http"] = null; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); + case 33: + message.deprecated = reader.bool(); break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + case 34: + message.idempotencyLevel = reader.int32(); break; - case 7: - message.body = reader.string(); + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; - case 12: - message.responseBody = reader.string(); + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); @@ -11948,240 +11410,217 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "custom." + error; + return "uninterpretedOption." + error; } } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.MethodOptions} MethodOptions */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** - * Converts this HttpRule to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; })(); - api.CustomHttpPattern = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12189,88 +11628,156 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - CustomHttpPattern.prototype.kind = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - CustomHttpPattern.prototype.path = ""; + UninterpretedOption.prototype.identifierValue = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; case 2: - message.path = reader.string(); + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -12281,288 +11788,501 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.name = []; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + /** - * Converts this CustomHttpPattern to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - return values; - })(); + UninterpretedOption.NamePart = (function() { - api.ResourceDescriptor = (function() { + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - */ + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -12573,418 +12293,467 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; + } return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - return ResourceDescriptor; - })(); + SourceCodeInfo.Location = (function() { - api.ResourceReference = (function() { + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return ResourceReference; - })(); + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; - return api; - })(); + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; - google.protobuf = (function() { + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - protobuf.FileDescriptorSet = (function() { + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of a GeneratedCodeInfo. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new FileDescriptorSet. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12992,78 +12761,78 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -13074,395 +12843,496 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileDescriptorSet.verify = function verify(message) { + GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) - return "file." + error; + return "annotation." + error; } } return null; }; /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + /** - * Converts this FileDescriptorSet to JSON. + * Converts this GeneratedCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ - FileDescriptorSet.prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorSet; - })(); + GeneratedCodeInfo.Annotation = (function() { - protobuf.FileDescriptorProto = (function() { + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - */ + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ - FileDescriptorProto.prototype.extension = $util.emptyArray; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - FileDescriptorProto.prototype.options = null; + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration * @instance */ - FileDescriptorProto.prototype.syntax = ""; + Duration.prototype.nanos = 0; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorProto.decode = function decode(reader, length) { + Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.seconds = reader.int64(); break; case 2: - message["package"] = reader.string(); + message.nanos = reader.int32(); break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -13470,329 +13340,131 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileDescriptorProto.verify = function verify(message) { + Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; return null; }; /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.Duration} Duration */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; return message; }; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorProto; + return Duration; })(); - protobuf.DescriptorProto = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a DescriptorProto. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new DescriptorProto. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13800,216 +13472,88 @@ } /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + Timestamp.prototype.nanos = 0; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DescriptorProto.decode = function decode(reader, length) { + Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.seconds = reader.int64(); break; case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); @@ -14020,10862 +13564,11737 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DescriptorProto.verify = function verify(message) { + Timestamp.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; return null; }; /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this DescriptorProto to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - DescriptorProto.ExtensionRange = (function() { + return Timestamp; + })(); - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ + protobuf.FieldMask = (function() { - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); } + return message; + }; - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; + return FieldMask; + })(); - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return protobuf; + })(); - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + google.cloud = (function() { - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; + cloud.kms = (function() { - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; + /** + * Namespace kms. + * @memberof google.cloud + * @namespace + */ + var kms = {}; - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; + kms.v1 = (function() { /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object + * Namespace v1. + * @memberof google.cloud.kms + * @namespace */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var v1 = {}; - return ReservedRange; - })(); + v1.KeyRing = (function() { - return DescriptorProto; - })(); + /** + * Properties of a KeyRing. + * @memberof google.cloud.kms.v1 + * @interface IKeyRing + * @property {string|null} [name] KeyRing name + * @property {google.protobuf.ITimestamp|null} [createTime] KeyRing createTime + */ - protobuf.ExtensionRangeOptions = (function() { + /** + * Constructs a new KeyRing. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a KeyRing. + * @implements IKeyRing + * @constructor + * @param {google.cloud.kms.v1.IKeyRing=} [properties] Properties to set + */ + function KeyRing(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * KeyRing name. + * @member {string} name + * @memberof google.cloud.kms.v1.KeyRing + * @instance + */ + KeyRing.prototype.name = ""; - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * KeyRing createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.kms.v1.KeyRing + * @instance + */ + KeyRing.prototype.createTime = null; - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; + /** + * Creates a new KeyRing instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {google.cloud.kms.v1.IKeyRing=} [properties] Properties to set + * @returns {google.cloud.kms.v1.KeyRing} KeyRing instance + */ + KeyRing.create = function create(properties) { + return new KeyRing(properties); + }; - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified KeyRing message. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {google.cloud.kms.v1.IKeyRing} message KeyRing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified KeyRing message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyRing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {google.cloud.kms.v1.IKeyRing} message KeyRing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a KeyRing message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.KeyRing} KeyRing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyRing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a KeyRing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.KeyRing} KeyRing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Verifies a KeyRing message. + * @function verify + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Creates a KeyRing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.KeyRing} KeyRing + */ + KeyRing.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.KeyRing) + return object; + var message = new $root.google.cloud.kms.v1.KeyRing(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.kms.v1.KeyRing.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a plain object from a KeyRing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.KeyRing + * @static + * @param {google.cloud.kms.v1.KeyRing} message KeyRing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this KeyRing to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.KeyRing + * @instance + * @returns {Object.} JSON object + */ + KeyRing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ExtensionRangeOptions; - })(); + return KeyRing; + })(); - protobuf.FieldDescriptorProto = (function() { + v1.CryptoKey = (function() { - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ + /** + * Properties of a CryptoKey. + * @memberof google.cloud.kms.v1 + * @interface ICryptoKey + * @property {string|null} [name] CryptoKey name + * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [primary] CryptoKey primary + * @property {google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose|null} [purpose] CryptoKey purpose + * @property {google.protobuf.ITimestamp|null} [createTime] CryptoKey createTime + * @property {google.protobuf.ITimestamp|null} [nextRotationTime] CryptoKey nextRotationTime + * @property {google.protobuf.IDuration|null} [rotationPeriod] CryptoKey rotationPeriod + * @property {google.cloud.kms.v1.ICryptoKeyVersionTemplate|null} [versionTemplate] CryptoKey versionTemplate + * @property {Object.|null} [labels] CryptoKey labels + */ - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new CryptoKey. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CryptoKey. + * @implements ICryptoKey + * @constructor + * @param {google.cloud.kms.v1.ICryptoKey=} [properties] Properties to set + */ + function CryptoKey(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; + /** + * CryptoKey name. + * @member {string} name + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.name = ""; - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; + /** + * CryptoKey primary. + * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} primary + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.primary = null; - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; + /** + * CryptoKey purpose. + * @member {google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose} purpose + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.purpose = 0; - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; + /** + * CryptoKey createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.createTime = null; - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; + /** + * CryptoKey nextRotationTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.nextRotationTime = null; - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; + /** + * CryptoKey rotationPeriod. + * @member {google.protobuf.IDuration|null|undefined} rotationPeriod + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.rotationPeriod = null; - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; + /** + * CryptoKey versionTemplate. + * @member {google.cloud.kms.v1.ICryptoKeyVersionTemplate|null|undefined} versionTemplate + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.versionTemplate = null; - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; + /** + * CryptoKey labels. + * @member {Object.} labels + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.labels = $util.emptyObject; - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - return writer; - }; + /** + * CryptoKey rotationSchedule. + * @member {"rotationPeriod"|undefined} rotationSchedule + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + Object.defineProperty(CryptoKey.prototype, "rotationSchedule", { + get: $util.oneOfGetter($oneOfFields = ["rotationPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new CryptoKey instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {google.cloud.kms.v1.ICryptoKey=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey instance + */ + CryptoKey.create = function create(properties) { + return new CryptoKey(properties); + }; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified CryptoKey message. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {google.cloud.kms.v1.ICryptoKey} message CryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.primary != null && message.hasOwnProperty("primary")) + $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.primary, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.purpose != null && message.hasOwnProperty("purpose")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.purpose); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) + $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) + $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.encode(message.versionTemplate, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified CryptoKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {google.cloud.kms.v1.ICryptoKey} message CryptoKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; + /** + * Decodes a CryptoKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKey(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); + break; + case 3: + message.purpose = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 11: + message.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.decode(reader, reader.uint32()); + break; + case 10: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoKey message. + * @function verify + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.primary != null && message.hasOwnProperty("primary")) { + var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.primary); + if (error) + return "primary." + error; + } + if (message.purpose != null && message.hasOwnProperty("purpose")) + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 1: + case 5: + case 6: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); + if (error) + return "nextRotationTime." + error; + } + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + properties.rotationSchedule = 1; + { + var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); + if (error) + return "rotationPeriod." + error; + } + } + if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) { + var error = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.verify(message.versionTemplate); + if (error) + return "versionTemplate." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CryptoKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CryptoKey} CryptoKey + */ + CryptoKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CryptoKey) + return object; + var message = new $root.google.cloud.kms.v1.CryptoKey(); + if (object.name != null) + message.name = String(object.name); + if (object.primary != null) { + if (typeof object.primary !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.primary: object expected"); + message.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.primary); + } + switch (object.purpose) { + case "CRYPTO_KEY_PURPOSE_UNSPECIFIED": + case 0: + message.purpose = 0; + break; + case "ENCRYPT_DECRYPT": + case 1: + message.purpose = 1; + break; + case "ASYMMETRIC_SIGN": + case 5: + message.purpose = 5; + break; + case "ASYMMETRIC_DECRYPT": + case 6: + message.purpose = 6; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.nextRotationTime != null) { + if (typeof object.nextRotationTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.nextRotationTime: object expected"); + message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); + } + if (object.rotationPeriod != null) { + if (typeof object.rotationPeriod !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.rotationPeriod: object expected"); + message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); + } + if (object.versionTemplate != null) { + if (typeof object.versionTemplate !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.versionTemplate: object expected"); + message.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.fromObject(object.versionTemplate); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a CryptoKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CryptoKey + * @static + * @param {google.cloud.kms.v1.CryptoKey} message CryptoKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.primary = null; + object.purpose = options.enums === String ? "CRYPTO_KEY_PURPOSE_UNSPECIFIED" : 0; + object.createTime = null; + object.nextRotationTime = null; + object.versionTemplate = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.primary, options); + if (message.purpose != null && message.hasOwnProperty("purpose")) + object.purpose = options.enums === String ? $root.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose[message.purpose] : message.purpose; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); + if (options.oneofs) + object.rotationSchedule = "rotationPeriod"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.versionTemplate != null && message.hasOwnProperty("versionTemplate")) + object.versionTemplate = $root.google.cloud.kms.v1.CryptoKeyVersionTemplate.toObject(message.versionTemplate, options); + return object; + }; + + /** + * Converts this CryptoKey to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + * @returns {Object.} JSON object + */ + CryptoKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CryptoKeyPurpose enum. + * @name google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose + * @enum {string} + * @property {number} CRYPTO_KEY_PURPOSE_UNSPECIFIED=0 CRYPTO_KEY_PURPOSE_UNSPECIFIED value + * @property {number} ENCRYPT_DECRYPT=1 ENCRYPT_DECRYPT value + * @property {number} ASYMMETRIC_SIGN=5 ASYMMETRIC_SIGN value + * @property {number} ASYMMETRIC_DECRYPT=6 ASYMMETRIC_DECRYPT value + */ + CryptoKey.CryptoKeyPurpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CRYPTO_KEY_PURPOSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPT_DECRYPT"] = 1; + values[valuesById[5] = "ASYMMETRIC_SIGN"] = 5; + values[valuesById[6] = "ASYMMETRIC_DECRYPT"] = 6; + return values; + })(); + + return CryptoKey; + })(); + + v1.CryptoKeyVersionTemplate = (function() { + + /** + * Properties of a CryptoKeyVersionTemplate. + * @memberof google.cloud.kms.v1 + * @interface ICryptoKeyVersionTemplate + * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] CryptoKeyVersionTemplate protectionLevel + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] CryptoKeyVersionTemplate algorithm + */ + + /** + * Constructs a new CryptoKeyVersionTemplate. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CryptoKeyVersionTemplate. + * @implements ICryptoKeyVersionTemplate + * @constructor + * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate=} [properties] Properties to set + */ + function CryptoKeyVersionTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; + /** + * CryptoKeyVersionTemplate protectionLevel. + * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @instance + */ + CryptoKeyVersionTemplate.prototype.protectionLevel = 0; + + /** + * CryptoKeyVersionTemplate algorithm. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @instance + */ + CryptoKeyVersionTemplate.prototype.algorithm = 0; + + /** + * Creates a new CryptoKeyVersionTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate instance + */ + CryptoKeyVersionTemplate.create = function create(properties) { + return new CryptoKeyVersionTemplate(properties); + }; + + /** + * Encodes the specified CryptoKeyVersionTemplate message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate} message CryptoKeyVersionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyVersionTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.protectionLevel); + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.algorithm); + return writer; + }; + + /** + * Encodes the specified CryptoKeyVersionTemplate message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersionTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersionTemplate} message CryptoKeyVersionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyVersionTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyVersionTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKeyVersionTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protectionLevel = reader.int32(); + break; + case 3: + message.algorithm = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoKeyVersionTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyVersionTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoKeyVersionTemplate message. + * @function verify + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKeyVersionTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + switch (message.protectionLevel) { + default: + return "protectionLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 15: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 17: + case 12: + case 13: + break; + } + return null; + }; + + /** + * Creates a CryptoKeyVersionTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CryptoKeyVersionTemplate} CryptoKeyVersionTemplate + */ + CryptoKeyVersionTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CryptoKeyVersionTemplate) + return object; + var message = new $root.google.cloud.kms.v1.CryptoKeyVersionTemplate(); + switch (object.protectionLevel) { + case "PROTECTION_LEVEL_UNSPECIFIED": + case 0: + message.protectionLevel = 0; + break; + case "SOFTWARE": + case 1: + message.protectionLevel = 1; + break; + case "HSM": + case 2: + message.protectionLevel = 2; + break; + case "EXTERNAL": + case 3: + message.protectionLevel = 3; + break; + } + switch (object.algorithm) { + case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "GOOGLE_SYMMETRIC_ENCRYPTION": + case 1: + message.algorithm = 1; + break; + case "RSA_SIGN_PSS_2048_SHA256": + case 2: + message.algorithm = 2; + break; + case "RSA_SIGN_PSS_3072_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_SIGN_PSS_4096_SHA256": + case 4: + message.algorithm = 4; + break; + case "RSA_SIGN_PSS_4096_SHA512": + case 15: + message.algorithm = 15; + break; + case "RSA_SIGN_PKCS1_2048_SHA256": + case 5: + message.algorithm = 5; + break; + case "RSA_SIGN_PKCS1_3072_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_SIGN_PKCS1_4096_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_SIGN_PKCS1_4096_SHA512": + case 16: + message.algorithm = 16; + break; + case "RSA_DECRYPT_OAEP_2048_SHA256": + case 8: + message.algorithm = 8; + break; + case "RSA_DECRYPT_OAEP_3072_SHA256": + case 9: + message.algorithm = 9; + break; + case "RSA_DECRYPT_OAEP_4096_SHA256": + case 10: + message.algorithm = 10; + break; + case "RSA_DECRYPT_OAEP_4096_SHA512": + case 17: + message.algorithm = 17; + break; + case "EC_SIGN_P256_SHA256": + case 12: + message.algorithm = 12; + break; + case "EC_SIGN_P384_SHA384": + case 13: + message.algorithm = 13; + break; + } + return message; + }; - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - return object; - }; + /** + * Creates a plain object from a CryptoKeyVersionTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @static + * @param {google.cloud.kms.v1.CryptoKeyVersionTemplate} message CryptoKeyVersionTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKeyVersionTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; + object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; + } + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + return object; + }; - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this CryptoKeyVersionTemplate to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CryptoKeyVersionTemplate + * @instance + * @returns {Object.} JSON object + */ + CryptoKeyVersionTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); + return CryptoKeyVersionTemplate; + })(); + + v1.KeyOperationAttestation = (function() { + + /** + * Properties of a KeyOperationAttestation. + * @memberof google.cloud.kms.v1 + * @interface IKeyOperationAttestation + * @property {google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat|null} [format] KeyOperationAttestation format + * @property {Uint8Array|null} [content] KeyOperationAttestation content + */ + + /** + * Constructs a new KeyOperationAttestation. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a KeyOperationAttestation. + * @implements IKeyOperationAttestation + * @constructor + * @param {google.cloud.kms.v1.IKeyOperationAttestation=} [properties] Properties to set + */ + function KeyOperationAttestation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyOperationAttestation format. + * @member {google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat} format + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @instance + */ + KeyOperationAttestation.prototype.format = 0; + + /** + * KeyOperationAttestation content. + * @member {Uint8Array} content + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @instance + */ + KeyOperationAttestation.prototype.content = $util.newBuffer([]); + + /** + * Creates a new KeyOperationAttestation instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {google.cloud.kms.v1.IKeyOperationAttestation=} [properties] Properties to set + * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation instance + */ + KeyOperationAttestation.create = function create(properties) { + return new KeyOperationAttestation(properties); + }; + + /** + * Encodes the specified KeyOperationAttestation message. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {google.cloud.kms.v1.IKeyOperationAttestation} message KeyOperationAttestation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyOperationAttestation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && message.hasOwnProperty("format")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.format); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified KeyOperationAttestation message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyOperationAttestation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {google.cloud.kms.v1.IKeyOperationAttestation} message KeyOperationAttestation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyOperationAttestation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyOperationAttestation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyOperationAttestation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyOperationAttestation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.format = reader.int32(); + break; + case 5: + message.content = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); + /** + * Decodes a KeyOperationAttestation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyOperationAttestation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return FieldDescriptorProto; - })(); + /** + * Verifies a KeyOperationAttestation message. + * @function verify + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyOperationAttestation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 3: + case 4: + break; + } + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + return null; + }; - protobuf.OneofDescriptorProto = (function() { + /** + * Creates a KeyOperationAttestation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.KeyOperationAttestation} KeyOperationAttestation + */ + KeyOperationAttestation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.KeyOperationAttestation) + return object; + var message = new $root.google.cloud.kms.v1.KeyOperationAttestation(); + switch (object.format) { + case "ATTESTATION_FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "CAVIUM_V1_COMPRESSED": + case 3: + message.format = 3; + break; + case "CAVIUM_V2_COMPRESSED": + case 4: + message.format = 4; + break; + } + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + return message; + }; - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ + /** + * Creates a plain object from a KeyOperationAttestation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @static + * @param {google.cloud.kms.v1.KeyOperationAttestation} message KeyOperationAttestation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyOperationAttestation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = options.enums === String ? "ATTESTATION_FORMAT_UNSPECIFIED" : 0; + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat[message.format] : message.format; + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this KeyOperationAttestation to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.KeyOperationAttestation + * @instance + * @returns {Object.} JSON object + */ + KeyOperationAttestation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; + /** + * AttestationFormat enum. + * @name google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat + * @enum {string} + * @property {number} ATTESTATION_FORMAT_UNSPECIFIED=0 ATTESTATION_FORMAT_UNSPECIFIED value + * @property {number} CAVIUM_V1_COMPRESSED=3 CAVIUM_V1_COMPRESSED value + * @property {number} CAVIUM_V2_COMPRESSED=4 CAVIUM_V2_COMPRESSED value + */ + KeyOperationAttestation.AttestationFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTESTATION_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[3] = "CAVIUM_V1_COMPRESSED"] = 3; + values[valuesById[4] = "CAVIUM_V2_COMPRESSED"] = 4; + return values; + })(); - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; + return KeyOperationAttestation; + })(); - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; + v1.CryptoKeyVersion = (function() { - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Properties of a CryptoKeyVersion. + * @memberof google.cloud.kms.v1 + * @interface ICryptoKeyVersion + * @property {string|null} [name] CryptoKeyVersion name + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState|null} [state] CryptoKeyVersion state + * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] CryptoKeyVersion protectionLevel + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] CryptoKeyVersion algorithm + * @property {google.cloud.kms.v1.IKeyOperationAttestation|null} [attestation] CryptoKeyVersion attestation + * @property {google.protobuf.ITimestamp|null} [createTime] CryptoKeyVersion createTime + * @property {google.protobuf.ITimestamp|null} [generateTime] CryptoKeyVersion generateTime + * @property {google.protobuf.ITimestamp|null} [destroyTime] CryptoKeyVersion destroyTime + * @property {google.protobuf.ITimestamp|null} [destroyEventTime] CryptoKeyVersion destroyEventTime + * @property {string|null} [importJob] CryptoKeyVersion importJob + * @property {google.protobuf.ITimestamp|null} [importTime] CryptoKeyVersion importTime + * @property {string|null} [importFailureReason] CryptoKeyVersion importFailureReason + */ + + /** + * Constructs a new CryptoKeyVersion. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CryptoKeyVersion. + * @implements ICryptoKeyVersion + * @constructor + * @param {google.cloud.kms.v1.ICryptoKeyVersion=} [properties] Properties to set + */ + function CryptoKeyVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoKeyVersion name. + * @member {string} name + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.name = ""; - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CryptoKeyVersion state. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState} state + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.state = 0; - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CryptoKeyVersion protectionLevel. + * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.protectionLevel = 0; - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CryptoKeyVersion algorithm. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.algorithm = 0; - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; + /** + * CryptoKeyVersion attestation. + * @member {google.cloud.kms.v1.IKeyOperationAttestation|null|undefined} attestation + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.attestation = null; - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; + /** + * CryptoKeyVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.createTime = null; - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; + /** + * CryptoKeyVersion generateTime. + * @member {google.protobuf.ITimestamp|null|undefined} generateTime + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.generateTime = null; - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CryptoKeyVersion destroyTime. + * @member {google.protobuf.ITimestamp|null|undefined} destroyTime + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.destroyTime = null; - return OneofDescriptorProto; - })(); + /** + * CryptoKeyVersion destroyEventTime. + * @member {google.protobuf.ITimestamp|null|undefined} destroyEventTime + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.destroyEventTime = null; - protobuf.EnumDescriptorProto = (function() { + /** + * CryptoKeyVersion importJob. + * @member {string} importJob + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.importJob = ""; - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ + /** + * CryptoKeyVersion importTime. + * @member {google.protobuf.ITimestamp|null|undefined} importTime + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.importTime = null; - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * CryptoKeyVersion importFailureReason. + * @member {string} importFailureReason + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + */ + CryptoKeyVersion.prototype.importFailureReason = ""; - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; + /** + * Creates a new CryptoKeyVersion instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersion=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion instance + */ + CryptoKeyVersion.create = function create(properties) { + return new CryptoKeyVersion(properties); + }; - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + /** + * Encodes the specified CryptoKeyVersion message. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersion} message CryptoKeyVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) + $root.google.protobuf.Timestamp.encode(message.destroyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) + $root.google.protobuf.Timestamp.encode(message.destroyEventTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.protectionLevel); + if (message.attestation != null && message.hasOwnProperty("attestation")) + $root.google.cloud.kms.v1.KeyOperationAttestation.encode(message.attestation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.algorithm); + if (message.generateTime != null && message.hasOwnProperty("generateTime")) + $root.google.protobuf.Timestamp.encode(message.generateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.importJob != null && message.hasOwnProperty("importJob")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.importJob); + if (message.importTime != null && message.hasOwnProperty("importTime")) + $root.google.protobuf.Timestamp.encode(message.importTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.importFailureReason); + return writer; + }; - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; + /** + * Encodes the specified CryptoKeyVersion message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CryptoKeyVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {google.cloud.kms.v1.ICryptoKeyVersion} message CryptoKeyVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + /** + * Decodes a CryptoKeyVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CryptoKeyVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.state = reader.int32(); + break; + case 7: + message.protectionLevel = reader.int32(); + break; + case 10: + message.algorithm = reader.int32(); + break; + case 8: + message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.decode(reader, reader.uint32()); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.generateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.destroyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.destroyEventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 14: + message.importJob = reader.string(); + break; + case 15: + message.importTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 16: + message.importFailureReason = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * Decodes a CryptoKeyVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; + /** + * Verifies a CryptoKeyVersion message. + * @function verify + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKeyVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 5: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + switch (message.protectionLevel) { + default: + return "protectionLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 15: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 17: + case 12: + case 13: + break; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.google.cloud.kms.v1.KeyOperationAttestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.generateTime != null && message.hasOwnProperty("generateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.generateTime); + if (error) + return "generateTime." + error; + } + if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.destroyTime); + if (error) + return "destroyTime." + error; + } + if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.destroyEventTime); + if (error) + return "destroyEventTime." + error; + } + if (message.importJob != null && message.hasOwnProperty("importJob")) + if (!$util.isString(message.importJob)) + return "importJob: string expected"; + if (message.importTime != null && message.hasOwnProperty("importTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.importTime); + if (error) + return "importTime." + error; + } + if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) + if (!$util.isString(message.importFailureReason)) + return "importFailureReason: string expected"; + return null; + }; - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; + /** + * Creates a CryptoKeyVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CryptoKeyVersion} CryptoKeyVersion + */ + CryptoKeyVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CryptoKeyVersion) + return object; + var message = new $root.google.cloud.kms.v1.CryptoKeyVersion(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING_GENERATION": + case 5: + message.state = 5; + break; + case "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "DESTROYED": + case 3: + message.state = 3; + break; + case "DESTROY_SCHEDULED": + case 4: + message.state = 4; + break; + case "PENDING_IMPORT": + case 6: + message.state = 6; + break; + case "IMPORT_FAILED": + case 7: + message.state = 7; + break; + } + switch (object.protectionLevel) { + case "PROTECTION_LEVEL_UNSPECIFIED": + case 0: + message.protectionLevel = 0; + break; + case "SOFTWARE": + case 1: + message.protectionLevel = 1; + break; + case "HSM": + case 2: + message.protectionLevel = 2; + break; + case "EXTERNAL": + case 3: + message.protectionLevel = 3; + break; + } + switch (object.algorithm) { + case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "GOOGLE_SYMMETRIC_ENCRYPTION": + case 1: + message.algorithm = 1; + break; + case "RSA_SIGN_PSS_2048_SHA256": + case 2: + message.algorithm = 2; + break; + case "RSA_SIGN_PSS_3072_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_SIGN_PSS_4096_SHA256": + case 4: + message.algorithm = 4; + break; + case "RSA_SIGN_PSS_4096_SHA512": + case 15: + message.algorithm = 15; + break; + case "RSA_SIGN_PKCS1_2048_SHA256": + case 5: + message.algorithm = 5; + break; + case "RSA_SIGN_PKCS1_3072_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_SIGN_PKCS1_4096_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_SIGN_PKCS1_4096_SHA512": + case 16: + message.algorithm = 16; + break; + case "RSA_DECRYPT_OAEP_2048_SHA256": + case 8: + message.algorithm = 8; + break; + case "RSA_DECRYPT_OAEP_3072_SHA256": + case 9: + message.algorithm = 9; + break; + case "RSA_DECRYPT_OAEP_4096_SHA256": + case 10: + message.algorithm = 10; + break; + case "RSA_DECRYPT_OAEP_4096_SHA512": + case 17: + message.algorithm = 17; + break; + case "EC_SIGN_P256_SHA256": + case 12: + message.algorithm = 12; + break; + case "EC_SIGN_P384_SHA384": + case 13: + message.algorithm = 13; + break; + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.attestation: object expected"); + message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.fromObject(object.attestation); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.generateTime != null) { + if (typeof object.generateTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.generateTime: object expected"); + message.generateTime = $root.google.protobuf.Timestamp.fromObject(object.generateTime); + } + if (object.destroyTime != null) { + if (typeof object.destroyTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.destroyTime: object expected"); + message.destroyTime = $root.google.protobuf.Timestamp.fromObject(object.destroyTime); + } + if (object.destroyEventTime != null) { + if (typeof object.destroyEventTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.destroyEventTime: object expected"); + message.destroyEventTime = $root.google.protobuf.Timestamp.fromObject(object.destroyEventTime); + } + if (object.importJob != null) + message.importJob = String(object.importJob); + if (object.importTime != null) { + if (typeof object.importTime !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKeyVersion.importTime: object expected"); + message.importTime = $root.google.protobuf.Timestamp.fromObject(object.importTime); + } + if (object.importFailureReason != null) + message.importFailureReason = String(object.importFailureReason); + return message; + }; - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a CryptoKeyVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @static + * @param {google.cloud.kms.v1.CryptoKeyVersion} message CryptoKeyVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKeyVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.destroyTime = null; + object.destroyEventTime = null; + object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; + object.attestation = null; + object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; + object.generateTime = null; + object.importJob = ""; + object.importTime = null; + object.importFailureReason = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) + object.destroyTime = $root.google.protobuf.Timestamp.toObject(message.destroyTime, options); + if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) + object.destroyEventTime = $root.google.protobuf.Timestamp.toObject(message.destroyEventTime, options); + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + if (message.generateTime != null && message.hasOwnProperty("generateTime")) + object.generateTime = $root.google.protobuf.Timestamp.toObject(message.generateTime, options); + if (message.importJob != null && message.hasOwnProperty("importJob")) + object.importJob = message.importJob; + if (message.importTime != null && message.hasOwnProperty("importTime")) + object.importTime = $root.google.protobuf.Timestamp.toObject(message.importTime, options); + if (message.importFailureReason != null && message.hasOwnProperty("importFailureReason")) + object.importFailureReason = message.importFailureReason; + return object; + }; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this CryptoKeyVersion to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CryptoKeyVersion + * @instance + * @returns {Object.} JSON object + */ + CryptoKeyVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CryptoKeyVersionAlgorithm enum. + * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm + * @enum {string} + * @property {number} CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED=0 CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED value + * @property {number} GOOGLE_SYMMETRIC_ENCRYPTION=1 GOOGLE_SYMMETRIC_ENCRYPTION value + * @property {number} RSA_SIGN_PSS_2048_SHA256=2 RSA_SIGN_PSS_2048_SHA256 value + * @property {number} RSA_SIGN_PSS_3072_SHA256=3 RSA_SIGN_PSS_3072_SHA256 value + * @property {number} RSA_SIGN_PSS_4096_SHA256=4 RSA_SIGN_PSS_4096_SHA256 value + * @property {number} RSA_SIGN_PSS_4096_SHA512=15 RSA_SIGN_PSS_4096_SHA512 value + * @property {number} RSA_SIGN_PKCS1_2048_SHA256=5 RSA_SIGN_PKCS1_2048_SHA256 value + * @property {number} RSA_SIGN_PKCS1_3072_SHA256=6 RSA_SIGN_PKCS1_3072_SHA256 value + * @property {number} RSA_SIGN_PKCS1_4096_SHA256=7 RSA_SIGN_PKCS1_4096_SHA256 value + * @property {number} RSA_SIGN_PKCS1_4096_SHA512=16 RSA_SIGN_PKCS1_4096_SHA512 value + * @property {number} RSA_DECRYPT_OAEP_2048_SHA256=8 RSA_DECRYPT_OAEP_2048_SHA256 value + * @property {number} RSA_DECRYPT_OAEP_3072_SHA256=9 RSA_DECRYPT_OAEP_3072_SHA256 value + * @property {number} RSA_DECRYPT_OAEP_4096_SHA256=10 RSA_DECRYPT_OAEP_4096_SHA256 value + * @property {number} RSA_DECRYPT_OAEP_4096_SHA512=17 RSA_DECRYPT_OAEP_4096_SHA512 value + * @property {number} EC_SIGN_P256_SHA256=12 EC_SIGN_P256_SHA256 value + * @property {number} EC_SIGN_P384_SHA384=13 EC_SIGN_P384_SHA384 value + */ + CryptoKeyVersion.CryptoKeyVersionAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_SYMMETRIC_ENCRYPTION"] = 1; + values[valuesById[2] = "RSA_SIGN_PSS_2048_SHA256"] = 2; + values[valuesById[3] = "RSA_SIGN_PSS_3072_SHA256"] = 3; + values[valuesById[4] = "RSA_SIGN_PSS_4096_SHA256"] = 4; + values[valuesById[15] = "RSA_SIGN_PSS_4096_SHA512"] = 15; + values[valuesById[5] = "RSA_SIGN_PKCS1_2048_SHA256"] = 5; + values[valuesById[6] = "RSA_SIGN_PKCS1_3072_SHA256"] = 6; + values[valuesById[7] = "RSA_SIGN_PKCS1_4096_SHA256"] = 7; + values[valuesById[16] = "RSA_SIGN_PKCS1_4096_SHA512"] = 16; + values[valuesById[8] = "RSA_DECRYPT_OAEP_2048_SHA256"] = 8; + values[valuesById[9] = "RSA_DECRYPT_OAEP_3072_SHA256"] = 9; + values[valuesById[10] = "RSA_DECRYPT_OAEP_4096_SHA256"] = 10; + values[valuesById[17] = "RSA_DECRYPT_OAEP_4096_SHA512"] = 17; + values[valuesById[12] = "EC_SIGN_P256_SHA256"] = 12; + values[valuesById[13] = "EC_SIGN_P384_SHA384"] = 13; + return values; + })(); - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; + /** + * CryptoKeyVersionState enum. + * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState + * @enum {string} + * @property {number} CRYPTO_KEY_VERSION_STATE_UNSPECIFIED=0 CRYPTO_KEY_VERSION_STATE_UNSPECIFIED value + * @property {number} PENDING_GENERATION=5 PENDING_GENERATION value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} DESTROYED=3 DESTROYED value + * @property {number} DESTROY_SCHEDULED=4 DESTROY_SCHEDULED value + * @property {number} PENDING_IMPORT=6 PENDING_IMPORT value + * @property {number} IMPORT_FAILED=7 IMPORT_FAILED value + */ + CryptoKeyVersion.CryptoKeyVersionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED"] = 0; + values[valuesById[5] = "PENDING_GENERATION"] = 5; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "DESTROYED"] = 3; + values[valuesById[4] = "DESTROY_SCHEDULED"] = 4; + values[valuesById[6] = "PENDING_IMPORT"] = 6; + values[valuesById[7] = "IMPORT_FAILED"] = 7; + return values; + })(); - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; + /** + * CryptoKeyVersionView enum. + * @name google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView + * @enum {string} + * @property {number} CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED=0 CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED value + * @property {number} FULL=1 FULL value + */ + CryptoKeyVersion.CryptoKeyVersionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + return values; + })(); - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; + return CryptoKeyVersion; + })(); - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v1.PublicKey = (function() { - EnumDescriptorProto.EnumReservedRange = (function() { + /** + * Properties of a PublicKey. + * @memberof google.cloud.kms.v1 + * @interface IPublicKey + * @property {string|null} [pem] PublicKey pem + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] PublicKey algorithm + */ - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ + /** + * Constructs a new PublicKey. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {google.cloud.kms.v1.IPublicKey=} [properties] Properties to set + */ + function PublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * PublicKey pem. + * @member {string} pem + * @memberof google.cloud.kms.v1.PublicKey + * @instance + */ + PublicKey.prototype.pem = ""; - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; + /** + * PublicKey algorithm. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm + * @memberof google.cloud.kms.v1.PublicKey + * @instance + */ + PublicKey.prototype.algorithm = 0; - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {google.cloud.kms.v1.IPublicKey=} [properties] Properties to set + * @returns {google.cloud.kms.v1.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {google.cloud.kms.v1.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pem != null && message.hasOwnProperty("pem")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pem); + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); + return writer; + }; - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {google.cloud.kms.v1.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pem = reader.string(); + break; + case 2: + message.algorithm = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Verifies a PublicKey message. + * @function verify + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pem != null && message.hasOwnProperty("pem")) + if (!$util.isString(message.pem)) + return "pem: string expected"; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 15: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 17: + case 12: + case 13: + break; + } + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.PublicKey) + return object; + var message = new $root.google.cloud.kms.v1.PublicKey(); + if (object.pem != null) + message.pem = String(object.pem); + switch (object.algorithm) { + case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "GOOGLE_SYMMETRIC_ENCRYPTION": case 1: - message.start = reader.int32(); + message.algorithm = 1; break; + case "RSA_SIGN_PSS_2048_SHA256": case 2: - message.end = reader.int32(); + message.algorithm = 2; break; - default: - reader.skipType(tag & 7); + case "RSA_SIGN_PSS_3072_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_SIGN_PSS_4096_SHA256": + case 4: + message.algorithm = 4; + break; + case "RSA_SIGN_PSS_4096_SHA512": + case 15: + message.algorithm = 15; + break; + case "RSA_SIGN_PKCS1_2048_SHA256": + case 5: + message.algorithm = 5; + break; + case "RSA_SIGN_PKCS1_3072_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_SIGN_PKCS1_4096_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_SIGN_PKCS1_4096_SHA512": + case 16: + message.algorithm = 16; + break; + case "RSA_DECRYPT_OAEP_2048_SHA256": + case 8: + message.algorithm = 8; + break; + case "RSA_DECRYPT_OAEP_3072_SHA256": + case 9: + message.algorithm = 9; + break; + case "RSA_DECRYPT_OAEP_4096_SHA256": + case 10: + message.algorithm = 10; break; + case "RSA_DECRYPT_OAEP_4096_SHA512": + case 17: + message.algorithm = 17; + break; + case "EC_SIGN_P256_SHA256": + case 12: + message.algorithm = 12; + break; + case "EC_SIGN_P384_SHA384": + case 13: + message.algorithm = 13; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.PublicKey + * @static + * @param {google.cloud.kms.v1.PublicKey} message PublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pem = ""; + object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; } + if (message.pem != null && message.hasOwnProperty("pem")) + object.pem = message.pem; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKey; + })(); + + v1.ImportJob = (function() { + + /** + * Properties of an ImportJob. + * @memberof google.cloud.kms.v1 + * @interface IImportJob + * @property {string|null} [name] ImportJob name + * @property {google.cloud.kms.v1.ImportJob.ImportMethod|null} [importMethod] ImportJob importMethod + * @property {google.cloud.kms.v1.ProtectionLevel|null} [protectionLevel] ImportJob protectionLevel + * @property {google.protobuf.ITimestamp|null} [createTime] ImportJob createTime + * @property {google.protobuf.ITimestamp|null} [generateTime] ImportJob generateTime + * @property {google.protobuf.ITimestamp|null} [expireTime] ImportJob expireTime + * @property {google.protobuf.ITimestamp|null} [expireEventTime] ImportJob expireEventTime + * @property {google.cloud.kms.v1.ImportJob.ImportJobState|null} [state] ImportJob state + * @property {google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null} [publicKey] ImportJob publicKey + * @property {google.cloud.kms.v1.IKeyOperationAttestation|null} [attestation] ImportJob attestation + */ + + /** + * Constructs a new ImportJob. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an ImportJob. + * @implements IImportJob + * @constructor + * @param {google.cloud.kms.v1.IImportJob=} [properties] Properties to set + */ + function ImportJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ImportJob name. + * @member {string} name + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.name = ""; - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; + /** + * ImportJob importMethod. + * @member {google.cloud.kms.v1.ImportJob.ImportMethod} importMethod + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.importMethod = 0; - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; + /** + * ImportJob protectionLevel. + * @member {google.cloud.kms.v1.ProtectionLevel} protectionLevel + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.protectionLevel = 0; - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; + /** + * ImportJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.createTime = null; - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ImportJob generateTime. + * @member {google.protobuf.ITimestamp|null|undefined} generateTime + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.generateTime = null; - return EnumReservedRange; - })(); + /** + * ImportJob expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.expireTime = null; - return EnumDescriptorProto; - })(); + /** + * ImportJob expireEventTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireEventTime + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.expireEventTime = null; - protobuf.EnumValueDescriptorProto = (function() { + /** + * ImportJob state. + * @member {google.cloud.kms.v1.ImportJob.ImportJobState} state + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.state = 0; - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ + /** + * ImportJob publicKey. + * @member {google.cloud.kms.v1.ImportJob.IWrappingPublicKey|null|undefined} publicKey + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.publicKey = null; - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ImportJob attestation. + * @member {google.cloud.kms.v1.IKeyOperationAttestation|null|undefined} attestation + * @memberof google.cloud.kms.v1.ImportJob + * @instance + */ + ImportJob.prototype.attestation = null; - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; + /** + * Creates a new ImportJob instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {google.cloud.kms.v1.IImportJob=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ImportJob} ImportJob instance + */ + ImportJob.create = function create(properties) { + return new ImportJob(properties); + }; - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; + /** + * Encodes the specified ImportJob message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {google.cloud.kms.v1.IImportJob} message ImportJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.importMethod != null && message.hasOwnProperty("importMethod")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.importMethod); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.generateTime != null && message.hasOwnProperty("generateTime")) + $root.google.protobuf.Timestamp.encode(message.generateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.encode(message.publicKey, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.attestation != null && message.hasOwnProperty("attestation")) + $root.google.cloud.kms.v1.KeyOperationAttestation.encode(message.attestation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.protectionLevel); + if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) + $root.google.protobuf.Timestamp.encode(message.expireEventTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; + /** + * Encodes the specified ImportJob message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {google.cloud.kms.v1.IImportJob} message ImportJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; + /** + * Decodes an ImportJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ImportJob} ImportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.importMethod = reader.int32(); + break; + case 9: + message.protectionLevel = reader.int32(); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.generateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.expireEventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.state = reader.int32(); + break; + case 7: + message.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.decode(reader, reader.uint32()); + break; + case 8: + message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Decodes an ImportJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ImportJob} ImportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an ImportJob message. + * @function verify + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.importMethod != null && message.hasOwnProperty("importMethod")) + switch (message.importMethod) { + default: + return "importMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + switch (message.protectionLevel) { + default: + return "protectionLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.generateTime != null && message.hasOwnProperty("generateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.generateTime); + if (error) + return "generateTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireEventTime); + if (error) + return "expireEventTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.google.cloud.kms.v1.KeyOperationAttestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + return null; + }; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates an ImportJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ImportJob} ImportJob + */ + ImportJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ImportJob) + return object; + var message = new $root.google.cloud.kms.v1.ImportJob(); + if (object.name != null) + message.name = String(object.name); + switch (object.importMethod) { + case "IMPORT_METHOD_UNSPECIFIED": + case 0: + message.importMethod = 0; + break; + case "RSA_OAEP_3072_SHA1_AES_256": + case 1: + message.importMethod = 1; + break; + case "RSA_OAEP_4096_SHA1_AES_256": + case 2: + message.importMethod = 2; + break; + } + switch (object.protectionLevel) { + case "PROTECTION_LEVEL_UNSPECIFIED": + case 0: + message.protectionLevel = 0; + break; + case "SOFTWARE": + case 1: + message.protectionLevel = 1; + break; + case "HSM": + case 2: + message.protectionLevel = 2; + break; + case "EXTERNAL": + case 3: + message.protectionLevel = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.generateTime != null) { + if (typeof object.generateTime !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.generateTime: object expected"); + message.generateTime = $root.google.protobuf.Timestamp.fromObject(object.generateTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.expireEventTime != null) { + if (typeof object.expireEventTime !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.expireEventTime: object expected"); + message.expireEventTime = $root.google.protobuf.Timestamp.fromObject(object.expireEventTime); + } + switch (object.state) { + case "IMPORT_JOB_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING_GENERATION": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "EXPIRED": + case 3: + message.state = 3; + break; + } + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.publicKey: object expected"); + message.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.fromObject(object.publicKey); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".google.cloud.kms.v1.ImportJob.attestation: object expected"); + message.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.fromObject(object.attestation); + } + return message; + }; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an ImportJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ImportJob + * @static + * @param {google.cloud.kms.v1.ImportJob} message ImportJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.importMethod = options.enums === String ? "IMPORT_METHOD_UNSPECIFIED" : 0; + object.createTime = null; + object.generateTime = null; + object.expireTime = null; + object.state = options.enums === String ? "IMPORT_JOB_STATE_UNSPECIFIED" : 0; + object.publicKey = null; + object.attestation = null; + object.protectionLevel = options.enums === String ? "PROTECTION_LEVEL_UNSPECIFIED" : 0; + object.expireEventTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.importMethod != null && message.hasOwnProperty("importMethod")) + object.importMethod = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportMethod[message.importMethod] : message.importMethod; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.generateTime != null && message.hasOwnProperty("generateTime")) + object.generateTime = $root.google.protobuf.Timestamp.toObject(message.generateTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportJobState[message.state] : message.state; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.toObject(message.publicKey, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); + if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) + object.expireEventTime = $root.google.protobuf.Timestamp.toObject(message.expireEventTime, options); + return object; + }; - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; + /** + * Converts this ImportJob to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ImportJob + * @instance + * @returns {Object.} JSON object + */ + ImportJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; + ImportJob.WrappingPublicKey = (function() { - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; + /** + * Properties of a WrappingPublicKey. + * @memberof google.cloud.kms.v1.ImportJob + * @interface IWrappingPublicKey + * @property {string|null} [pem] WrappingPublicKey pem + */ - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new WrappingPublicKey. + * @memberof google.cloud.kms.v1.ImportJob + * @classdesc Represents a WrappingPublicKey. + * @implements IWrappingPublicKey + * @constructor + * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey=} [properties] Properties to set + */ + function WrappingPublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return EnumValueDescriptorProto; - })(); + /** + * WrappingPublicKey pem. + * @member {string} pem + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @instance + */ + WrappingPublicKey.prototype.pem = ""; - protobuf.ServiceDescriptorProto = (function() { + /** + * Creates a new WrappingPublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey instance + */ + WrappingPublicKey.create = function create(properties) { + return new WrappingPublicKey(properties); + }; - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ + /** + * Encodes the specified WrappingPublicKey message. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey} message WrappingPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WrappingPublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pem != null && message.hasOwnProperty("pem")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pem); + return writer; + }; + + /** + * Encodes the specified WrappingPublicKey message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportJob.WrappingPublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {google.cloud.kms.v1.ImportJob.IWrappingPublicKey} message WrappingPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WrappingPublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a WrappingPublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WrappingPublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pem = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; + /** + * Decodes a WrappingPublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WrappingPublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + /** + * Verifies a WrappingPublicKey message. + * @function verify + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WrappingPublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pem != null && message.hasOwnProperty("pem")) + if (!$util.isString(message.pem)) + return "pem: string expected"; + return null; + }; - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; + /** + * Creates a WrappingPublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ImportJob.WrappingPublicKey} WrappingPublicKey + */ + WrappingPublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey) + return object; + var message = new $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey(); + if (object.pem != null) + message.pem = String(object.pem); + return message; + }; - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; + /** + * Creates a plain object from a WrappingPublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @static + * @param {google.cloud.kms.v1.ImportJob.WrappingPublicKey} message WrappingPublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WrappingPublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pem = ""; + if (message.pem != null && message.hasOwnProperty("pem")) + object.pem = message.pem; + return object; + }; - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Converts this WrappingPublicKey to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ImportJob.WrappingPublicKey + * @instance + * @returns {Object.} JSON object + */ + WrappingPublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return WrappingPublicKey; + })(); - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ImportMethod enum. + * @name google.cloud.kms.v1.ImportJob.ImportMethod + * @enum {string} + * @property {number} IMPORT_METHOD_UNSPECIFIED=0 IMPORT_METHOD_UNSPECIFIED value + * @property {number} RSA_OAEP_3072_SHA1_AES_256=1 RSA_OAEP_3072_SHA1_AES_256 value + * @property {number} RSA_OAEP_4096_SHA1_AES_256=2 RSA_OAEP_4096_SHA1_AES_256 value + */ + ImportJob.ImportMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "RSA_OAEP_3072_SHA1_AES_256"] = 1; + values[valuesById[2] = "RSA_OAEP_4096_SHA1_AES_256"] = 2; + return values; + })(); + + /** + * ImportJobState enum. + * @name google.cloud.kms.v1.ImportJob.ImportJobState + * @enum {string} + * @property {number} IMPORT_JOB_STATE_UNSPECIFIED=0 IMPORT_JOB_STATE_UNSPECIFIED value + * @property {number} PENDING_GENERATION=1 PENDING_GENERATION value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} EXPIRED=3 EXPIRED value + */ + ImportJob.ImportJobState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_JOB_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_GENERATION"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + return values; + })(); - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ImportJob; + })(); - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; + /** + * ProtectionLevel enum. + * @name google.cloud.kms.v1.ProtectionLevel + * @enum {string} + * @property {number} PROTECTION_LEVEL_UNSPECIFIED=0 PROTECTION_LEVEL_UNSPECIFIED value + * @property {number} SOFTWARE=1 SOFTWARE value + * @property {number} HSM=2 HSM value + * @property {number} EXTERNAL=3 EXTERNAL value + */ + v1.ProtectionLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROTECTION_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOFTWARE"] = 1; + values[valuesById[2] = "HSM"] = 2; + values[valuesById[3] = "EXTERNAL"] = 3; + return values; + })(); - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + v1.KeyManagementService = (function() { + + /** + * Constructs a new KeyManagementService service. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a KeyManagementService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function KeyManagementService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; + (KeyManagementService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = KeyManagementService; - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates new KeyManagementService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.kms.v1.KeyManagementService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {KeyManagementService} RPC service. Useful where requests and/or responses are streamed. + */ + KeyManagementService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - return ServiceDescriptorProto; - })(); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listKeyRings}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef ListKeyRingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ListKeyRingsResponse} [response] ListKeyRingsResponse + */ - protobuf.MethodDescriptorProto = (function() { + /** + * Calls ListKeyRings. + * @function listKeyRings + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListKeyRingsRequest} request ListKeyRingsRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.ListKeyRingsCallback} callback Node-style callback called with the error, if any, and ListKeyRingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.listKeyRings = function listKeyRings(request, callback) { + return this.rpcCall(listKeyRings, $root.google.cloud.kms.v1.ListKeyRingsRequest, $root.google.cloud.kms.v1.ListKeyRingsResponse, request, callback); + }, "name", { value: "ListKeyRings" }); - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ + /** + * Calls ListKeyRings. + * @function listKeyRings + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListKeyRingsRequest} request ListKeyRingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeys}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef ListCryptoKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ListCryptoKeysResponse} [response] ListCryptoKeysResponse + */ + + /** + * Calls ListCryptoKeys. + * @function listCryptoKeys + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListCryptoKeysRequest} request ListCryptoKeysRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.ListCryptoKeysCallback} callback Node-style callback called with the error, if any, and ListCryptoKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.listCryptoKeys = function listCryptoKeys(request, callback) { + return this.rpcCall(listCryptoKeys, $root.google.cloud.kms.v1.ListCryptoKeysRequest, $root.google.cloud.kms.v1.ListCryptoKeysResponse, request, callback); + }, "name", { value: "ListCryptoKeys" }); + + /** + * Calls ListCryptoKeys. + * @function listCryptoKeys + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListCryptoKeysRequest} request ListCryptoKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listCryptoKeyVersions}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef ListCryptoKeyVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} [response] ListCryptoKeyVersionsResponse + */ + + /** + * Calls ListCryptoKeyVersions. + * @function listCryptoKeyVersions + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} request ListCryptoKeyVersionsRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersionsCallback} callback Node-style callback called with the error, if any, and ListCryptoKeyVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.listCryptoKeyVersions = function listCryptoKeyVersions(request, callback) { + return this.rpcCall(listCryptoKeyVersions, $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest, $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse, request, callback); + }, "name", { value: "ListCryptoKeyVersions" }); - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls ListCryptoKeyVersions. + * @function listCryptoKeyVersions + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} request ListCryptoKeyVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#listImportJobs}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef ListImportJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ListImportJobsResponse} [response] ListImportJobsResponse + */ - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; + /** + * Calls ListImportJobs. + * @function listImportJobs + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListImportJobsRequest} request ListImportJobsRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.ListImportJobsCallback} callback Node-style callback called with the error, if any, and ListImportJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.listImportJobs = function listImportJobs(request, callback) { + return this.rpcCall(listImportJobs, $root.google.cloud.kms.v1.ListImportJobsRequest, $root.google.cloud.kms.v1.ListImportJobsResponse, request, callback); + }, "name", { value: "ListImportJobs" }); - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; + /** + * Calls ListImportJobs. + * @function listImportJobs + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IListImportJobsRequest} request ListImportJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getKeyRing}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef GetKeyRingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.KeyRing} [response] KeyRing + */ - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; + /** + * Calls GetKeyRing. + * @function getKeyRing + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetKeyRingRequest} request GetKeyRingRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.GetKeyRingCallback} callback Node-style callback called with the error, if any, and KeyRing + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.getKeyRing = function getKeyRing(request, callback) { + return this.rpcCall(getKeyRing, $root.google.cloud.kms.v1.GetKeyRingRequest, $root.google.cloud.kms.v1.KeyRing, request, callback); + }, "name", { value: "GetKeyRing" }); - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; + /** + * Calls GetKeyRing. + * @function getKeyRing + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetKeyRingRequest} request GetKeyRingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKey}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef GetCryptoKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey + */ - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; + /** + * Calls GetCryptoKey. + * @function getCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} request GetCryptoKeyRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.GetCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.getCryptoKey = function getCryptoKey(request, callback) { + return this.rpcCall(getCryptoKey, $root.google.cloud.kms.v1.GetCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); + }, "name", { value: "GetCryptoKey" }); - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls GetCryptoKey. + * @function getCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} request GetCryptoKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef GetCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls GetCryptoKeyVersion. + * @function getCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} request GetCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.getCryptoKeyVersion = function getCryptoKeyVersion(request, callback) { + return this.rpcCall(getCryptoKeyVersion, $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "GetCryptoKeyVersion" }); - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; + /** + * Calls GetCryptoKeyVersion. + * @function getCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} request GetCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getPublicKey}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef GetPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.PublicKey} [response] PublicKey + */ - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; + /** + * Calls GetPublicKey. + * @function getPublicKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetPublicKeyRequest} request GetPublicKeyRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.GetPublicKeyCallback} callback Node-style callback called with the error, if any, and PublicKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.getPublicKey = function getPublicKey(request, callback) { + return this.rpcCall(getPublicKey, $root.google.cloud.kms.v1.GetPublicKeyRequest, $root.google.cloud.kms.v1.PublicKey, request, callback); + }, "name", { value: "GetPublicKey" }); - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls GetPublicKey. + * @function getPublicKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetPublicKeyRequest} request GetPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return MethodDescriptorProto; - })(); + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#getImportJob}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef GetImportJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ImportJob} [response] ImportJob + */ - protobuf.FileOptions = (function() { + /** + * Calls GetImportJob. + * @function getImportJob + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetImportJobRequest} request GetImportJobRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.GetImportJobCallback} callback Node-style callback called with the error, if any, and ImportJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.getImportJob = function getImportJob(request, callback) { + return this.rpcCall(getImportJob, $root.google.cloud.kms.v1.GetImportJobRequest, $root.google.cloud.kms.v1.ImportJob, request, callback); + }, "name", { value: "GetImportJob" }); - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ + /** + * Calls GetImportJob. + * @function getImportJob + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IGetImportJobRequest} request GetImportJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createKeyRing}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef CreateKeyRingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.KeyRing} [response] KeyRing + */ - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; + /** + * Calls CreateKeyRing. + * @function createKeyRing + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateKeyRingRequest} request CreateKeyRingRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.CreateKeyRingCallback} callback Node-style callback called with the error, if any, and KeyRing + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.createKeyRing = function createKeyRing(request, callback) { + return this.rpcCall(createKeyRing, $root.google.cloud.kms.v1.CreateKeyRingRequest, $root.google.cloud.kms.v1.KeyRing, request, callback); + }, "name", { value: "CreateKeyRing" }); - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; + /** + * Calls CreateKeyRing. + * @function createKeyRing + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateKeyRingRequest} request CreateKeyRingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKey}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef CreateCryptoKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey + */ - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + /** + * Calls CreateCryptoKey. + * @function createCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} request CreateCryptoKeyRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.createCryptoKey = function createCryptoKey(request, callback) { + return this.rpcCall(createCryptoKey, $root.google.cloud.kms.v1.CreateCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); + }, "name", { value: "CreateCryptoKey" }); - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; + /** + * Calls CreateCryptoKey. + * @function createCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} request CreateCryptoKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef CreateCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; + /** + * Calls CreateCryptoKeyVersion. + * @function createCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} request CreateCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.createCryptoKeyVersion = function createCryptoKeyVersion(request, callback) { + return this.rpcCall(createCryptoKeyVersion, $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "CreateCryptoKeyVersion" }); - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; + /** + * Calls CreateCryptoKeyVersion. + * @function createCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} request CreateCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#importCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef ImportCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; + /** + * Calls ImportCryptoKeyVersion. + * @function importCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} request ImportCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.importCryptoKeyVersion = function importCryptoKeyVersion(request, callback) { + return this.rpcCall(importCryptoKeyVersion, $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "ImportCryptoKeyVersion" }); - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; + /** + * Calls ImportCryptoKeyVersion. + * @function importCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} request ImportCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#createImportJob}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef CreateImportJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.ImportJob} [response] ImportJob + */ - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = false; + /** + * Calls CreateImportJob. + * @function createImportJob + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateImportJobRequest} request CreateImportJobRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.CreateImportJobCallback} callback Node-style callback called with the error, if any, and ImportJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.createImportJob = function createImportJob(request, callback) { + return this.rpcCall(createImportJob, $root.google.cloud.kms.v1.CreateImportJobRequest, $root.google.cloud.kms.v1.ImportJob, request, callback); + }, "name", { value: "CreateImportJob" }); - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + /** + * Calls CreateImportJob. + * @function createImportJob + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.ICreateImportJobRequest} request CreateImportJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKey}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef UpdateCryptoKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey + */ - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + /** + * Calls UpdateCryptoKey. + * @function updateCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} request UpdateCryptoKeyRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyCallback} callback Node-style callback called with the error, if any, and CryptoKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.updateCryptoKey = function updateCryptoKey(request, callback) { + return this.rpcCall(updateCryptoKey, $root.google.cloud.kms.v1.UpdateCryptoKeyRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); + }, "name", { value: "UpdateCryptoKey" }); - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; + /** + * Calls UpdateCryptoKey. + * @function updateCryptoKey + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} request UpdateCryptoKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef UpdateCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + /** + * Calls UpdateCryptoKeyVersion. + * @function updateCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} request UpdateCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.updateCryptoKeyVersion = function updateCryptoKeyVersion(request, callback) { + return this.rpcCall(updateCryptoKeyVersion, $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "UpdateCryptoKeyVersion" }); - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; + /** + * Calls UpdateCryptoKeyVersion. + * @function updateCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} request UpdateCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#encrypt}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef EncryptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.EncryptResponse} [response] EncryptResponse + */ - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Calls Encrypt. + * @function encrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IEncryptRequest} request EncryptRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.EncryptCallback} callback Node-style callback called with the error, if any, and EncryptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.encrypt = function encrypt(request, callback) { + return this.rpcCall(encrypt, $root.google.cloud.kms.v1.EncryptRequest, $root.google.cloud.kms.v1.EncryptResponse, request, callback); + }, "name", { value: "Encrypt" }); - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** + * Calls Encrypt. + * @function encrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IEncryptRequest} request EncryptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#decrypt}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef DecryptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.DecryptResponse} [response] DecryptResponse + */ - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; + /** + * Calls Decrypt. + * @function decrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IDecryptRequest} request DecryptRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.DecryptCallback} callback Node-style callback called with the error, if any, and DecryptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.decrypt = function decrypt(request, callback) { + return this.rpcCall(decrypt, $root.google.cloud.kms.v1.DecryptRequest, $root.google.cloud.kms.v1.DecryptResponse, request, callback); + }, "name", { value: "Decrypt" }); - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls Decrypt. + * @function decrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IDecryptRequest} request DecryptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricSign}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef AsymmetricSignCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.AsymmetricSignResponse} [response] AsymmetricSignResponse + */ - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls AsymmetricSign. + * @function asymmetricSign + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IAsymmetricSignRequest} request AsymmetricSignRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.AsymmetricSignCallback} callback Node-style callback called with the error, if any, and AsymmetricSignResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.asymmetricSign = function asymmetricSign(request, callback) { + return this.rpcCall(asymmetricSign, $root.google.cloud.kms.v1.AsymmetricSignRequest, $root.google.cloud.kms.v1.AsymmetricSignResponse, request, callback); + }, "name", { value: "AsymmetricSign" }); - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls AsymmetricSign. + * @function asymmetricSign + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IAsymmetricSignRequest} request AsymmetricSignRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#asymmetricDecrypt}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef AsymmetricDecryptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.AsymmetricDecryptResponse} [response] AsymmetricDecryptResponse + */ + + /** + * Calls AsymmetricDecrypt. + * @function asymmetricDecrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} request AsymmetricDecryptRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.AsymmetricDecryptCallback} callback Node-style callback called with the error, if any, and AsymmetricDecryptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.asymmetricDecrypt = function asymmetricDecrypt(request, callback) { + return this.rpcCall(asymmetricDecrypt, $root.google.cloud.kms.v1.AsymmetricDecryptRequest, $root.google.cloud.kms.v1.AsymmetricDecryptResponse, request, callback); + }, "name", { value: "AsymmetricDecrypt" }); - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; + /** + * Calls AsymmetricDecrypt. + * @function asymmetricDecrypt + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} request AsymmetricDecryptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#updateCryptoKeyPrimaryVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef UpdateCryptoKeyPrimaryVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKey} [response] CryptoKey + */ + + /** + * Calls UpdateCryptoKeyPrimaryVersion. + * @function updateCryptoKeyPrimaryVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} request UpdateCryptoKeyPrimaryVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersionCallback} callback Node-style callback called with the error, if any, and CryptoKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.updateCryptoKeyPrimaryVersion = function updateCryptoKeyPrimaryVersion(request, callback) { + return this.rpcCall(updateCryptoKeyPrimaryVersion, $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest, $root.google.cloud.kms.v1.CryptoKey, request, callback); + }, "name", { value: "UpdateCryptoKeyPrimaryVersion" }); + + /** + * Calls UpdateCryptoKeyPrimaryVersion. + * @function updateCryptoKeyPrimaryVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} request UpdateCryptoKeyPrimaryVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#destroyCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef DestroyCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ + + /** + * Calls DestroyCryptoKeyVersion. + * @function destroyCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} request DestroyCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.destroyCryptoKeyVersion = function destroyCryptoKeyVersion(request, callback) { + return this.rpcCall(destroyCryptoKeyVersion, $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "DestroyCryptoKeyVersion" }); + + /** + * Calls DestroyCryptoKeyVersion. + * @function destroyCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} request DestroyCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.kms.v1.KeyManagementService#restoreCryptoKeyVersion}. + * @memberof google.cloud.kms.v1.KeyManagementService + * @typedef RestoreCryptoKeyVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.kms.v1.CryptoKeyVersion} [response] CryptoKeyVersion + */ - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls RestoreCryptoKeyVersion. + * @function restoreCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} request RestoreCryptoKeyVersionRequest message or plain object + * @param {google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersionCallback} callback Node-style callback called with the error, if any, and CryptoKeyVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KeyManagementService.prototype.restoreCryptoKeyVersion = function restoreCryptoKeyVersion(request, callback) { + return this.rpcCall(restoreCryptoKeyVersion, $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest, $root.google.cloud.kms.v1.CryptoKeyVersion, request, callback); + }, "name", { value: "RestoreCryptoKeyVersion" }); - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); + /** + * Calls RestoreCryptoKeyVersion. + * @function restoreCryptoKeyVersion + * @memberof google.cloud.kms.v1.KeyManagementService + * @instance + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} request RestoreCryptoKeyVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return FileOptions; - })(); + return KeyManagementService; + })(); - protobuf.MessageOptions = (function() { + v1.ListKeyRingsRequest = (function() { - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ + /** + * Properties of a ListKeyRingsRequest. + * @memberof google.cloud.kms.v1 + * @interface IListKeyRingsRequest + * @property {string|null} [parent] ListKeyRingsRequest parent + * @property {number|null} [pageSize] ListKeyRingsRequest pageSize + * @property {string|null} [pageToken] ListKeyRingsRequest pageToken + * @property {string|null} [filter] ListKeyRingsRequest filter + * @property {string|null} [orderBy] ListKeyRingsRequest orderBy + */ - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new ListKeyRingsRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListKeyRingsRequest. + * @implements IListKeyRingsRequest + * @constructor + * @param {google.cloud.kms.v1.IListKeyRingsRequest=} [properties] Properties to set + */ + function ListKeyRingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; + /** + * ListKeyRingsRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + */ + ListKeyRingsRequest.prototype.parent = ""; - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + /** + * ListKeyRingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + */ + ListKeyRingsRequest.prototype.pageSize = 0; + + /** + * ListKeyRingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + */ + ListKeyRingsRequest.prototype.pageToken = ""; + + /** + * ListKeyRingsRequest filter. + * @member {string} filter + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + */ + ListKeyRingsRequest.prototype.filter = ""; + + /** + * ListKeyRingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + */ + ListKeyRingsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListKeyRingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {google.cloud.kms.v1.IListKeyRingsRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest instance + */ + ListKeyRingsRequest.create = function create(properties) { + return new ListKeyRingsRequest(properties); + }; + + /** + * Encodes the specified ListKeyRingsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {google.cloud.kms.v1.IListKeyRingsRequest} message ListKeyRingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeyRingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListKeyRingsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {google.cloud.kms.v1.IListKeyRingsRequest} message ListKeyRingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeyRingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeyRingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeyRingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListKeyRingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeyRingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeyRingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; + /** + * Verifies a ListKeyRingsRequest message. + * @function verify + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeyRingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; + /** + * Creates a ListKeyRingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListKeyRingsRequest} ListKeyRingsRequest + */ + ListKeyRingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListKeyRingsRequest) + return object; + var message = new $root.google.cloud.kms.v1.ListKeyRingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Creates a plain object from a ListKeyRingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @static + * @param {google.cloud.kms.v1.ListKeyRingsRequest} message ListKeyRingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeyRingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; + /** + * Converts this ListKeyRingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListKeyRingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListKeyRingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; + return ListKeyRingsRequest; + })(); - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; + v1.ListCryptoKeysRequest = (function() { - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a ListCryptoKeysRequest. + * @memberof google.cloud.kms.v1 + * @interface IListCryptoKeysRequest + * @property {string|null} [parent] ListCryptoKeysRequest parent + * @property {number|null} [pageSize] ListCryptoKeysRequest pageSize + * @property {string|null} [pageToken] ListCryptoKeysRequest pageToken + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null} [versionView] ListCryptoKeysRequest versionView + * @property {string|null} [filter] ListCryptoKeysRequest filter + * @property {string|null} [orderBy] ListCryptoKeysRequest orderBy + */ - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new ListCryptoKeysRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListCryptoKeysRequest. + * @implements IListCryptoKeysRequest + * @constructor + * @param {google.cloud.kms.v1.IListCryptoKeysRequest=} [properties] Properties to set + */ + function ListCryptoKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ListCryptoKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.parent = ""; + + /** + * ListCryptoKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.pageSize = 0; - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; + /** + * ListCryptoKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.pageToken = ""; - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; + /** + * ListCryptoKeysRequest versionView. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} versionView + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.versionView = 0; - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; + /** + * ListCryptoKeysRequest filter. + * @member {string} filter + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.filter = ""; + + /** + * ListCryptoKeysRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + */ + ListCryptoKeysRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCryptoKeysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest instance + */ + ListCryptoKeysRequest.create = function create(properties) { + return new ListCryptoKeysRequest(properties); + }; + + /** + * Encodes the specified ListCryptoKeysRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysRequest} message ListCryptoKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.versionView != null && message.hasOwnProperty("versionView")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.versionView); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCryptoKeysRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysRequest} message ListCryptoKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCryptoKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.versionView = reader.int32(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ListCryptoKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return MessageOptions; - })(); + /** + * Verifies a ListCryptoKeysRequest message. + * @function verify + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCryptoKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.versionView != null && message.hasOwnProperty("versionView")) + switch (message.versionView) { + default: + return "versionView: enum value expected"; + case 0: + case 1: + break; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; - protobuf.FieldOptions = (function() { + /** + * Creates a ListCryptoKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListCryptoKeysRequest} ListCryptoKeysRequest + */ + ListCryptoKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeysRequest) + return object; + var message = new $root.google.cloud.kms.v1.ListCryptoKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.versionView) { + case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": + case 0: + message.versionView = 0; + break; + case "FULL": + case 1: + message.versionView = 1; + break; + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ + /** + * Creates a plain object from a ListCryptoKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @static + * @param {google.cloud.kms.v1.ListCryptoKeysRequest} message ListCryptoKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCryptoKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.versionView = options.enums === String ? "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED" : 0; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.versionView != null && message.hasOwnProperty("versionView")) + object.versionView = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.versionView] : message.versionView; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this ListCryptoKeysRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListCryptoKeysRequest + * @instance + * @returns {Object.} JSON object + */ + ListCryptoKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; + return ListCryptoKeysRequest; + })(); - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; + v1.ListCryptoKeyVersionsRequest = (function() { - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; + /** + * Properties of a ListCryptoKeyVersionsRequest. + * @memberof google.cloud.kms.v1 + * @interface IListCryptoKeyVersionsRequest + * @property {string|null} [parent] ListCryptoKeyVersionsRequest parent + * @property {number|null} [pageSize] ListCryptoKeyVersionsRequest pageSize + * @property {string|null} [pageToken] ListCryptoKeyVersionsRequest pageToken + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView|null} [view] ListCryptoKeyVersionsRequest view + * @property {string|null} [filter] ListCryptoKeyVersionsRequest filter + * @property {string|null} [orderBy] ListCryptoKeyVersionsRequest orderBy + */ - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; + /** + * Constructs a new ListCryptoKeyVersionsRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListCryptoKeyVersionsRequest. + * @implements IListCryptoKeyVersionsRequest + * @constructor + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest=} [properties] Properties to set + */ + function ListCryptoKeyVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; + /** + * ListCryptoKeyVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.parent = ""; + + /** + * ListCryptoKeyVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.pageSize = 0; - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; + /** + * ListCryptoKeyVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.pageToken = ""; - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ListCryptoKeyVersionsRequest view. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} view + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.view = 0; - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * ListCryptoKeyVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.filter = ""; - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + /** + * ListCryptoKeyVersionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + */ + ListCryptoKeyVersionsRequest.prototype.orderBy = ""; - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; + /** + * Creates a new ListCryptoKeyVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest instance + */ + ListCryptoKeyVersionsRequest.create = function create(properties) { + return new ListCryptoKeyVersionsRequest(properties); + }; - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListCryptoKeyVersionsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeyVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListCryptoKeyVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeyVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeyVersionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.view = reader.int32(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListCryptoKeyVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeyVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; + /** + * Verifies a ListCryptoKeyVersionsRequest message. + * @function verify + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCryptoKeyVersionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; + /** + * Creates a ListCryptoKeyVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} ListCryptoKeyVersionsRequest + */ + ListCryptoKeyVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest) + return object; + var message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; + case "FULL": + case 1: + message.view = 1; break; } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; + /** + * Creates a plain object from a ListCryptoKeyVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @static + * @param {google.cloud.kms.v1.ListCryptoKeyVersionsRequest} message ListCryptoKeyVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCryptoKeyVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED" : 0; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.view] : message.view; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this ListCryptoKeyVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCryptoKeyVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {string} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); + return ListCryptoKeyVersionsRequest; + })(); - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {string} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); + v1.ListImportJobsRequest = (function() { - return FieldOptions; - })(); + /** + * Properties of a ListImportJobsRequest. + * @memberof google.cloud.kms.v1 + * @interface IListImportJobsRequest + * @property {string|null} [parent] ListImportJobsRequest parent + * @property {number|null} [pageSize] ListImportJobsRequest pageSize + * @property {string|null} [pageToken] ListImportJobsRequest pageToken + * @property {string|null} [filter] ListImportJobsRequest filter + * @property {string|null} [orderBy] ListImportJobsRequest orderBy + */ - protobuf.OneofOptions = (function() { + /** + * Constructs a new ListImportJobsRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListImportJobsRequest. + * @implements IListImportJobsRequest + * @constructor + * @param {google.cloud.kms.v1.IListImportJobsRequest=} [properties] Properties to set + */ + function ListImportJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ + /** + * ListImportJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + */ + ListImportJobsRequest.prototype.parent = ""; - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListImportJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + */ + ListImportJobsRequest.prototype.pageSize = 0; - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ListImportJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + */ + ListImportJobsRequest.prototype.pageToken = ""; - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; + /** + * ListImportJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + */ + ListImportJobsRequest.prototype.filter = ""; - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * ListImportJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + */ + ListImportJobsRequest.prototype.orderBy = ""; - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new ListImportJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {google.cloud.kms.v1.IListImportJobsRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest instance + */ + ListImportJobsRequest.create = function create(properties) { + return new ListImportJobsRequest(properties); + }; - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified ListImportJobsRequest message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {google.cloud.kms.v1.IListImportJobsRequest} message ListImportJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImportJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListImportJobsRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {google.cloud.kms.v1.IListImportJobsRequest} message ListImportJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImportJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Decodes a ListImportJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImportJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListImportJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Decodes a ListImportJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImportJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListImportJobsRequest message. + * @function verify + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListImportJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a ListImportJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListImportJobsRequest} ListImportJobsRequest + */ + ListImportJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListImportJobsRequest) + return object; + var message = new $root.google.cloud.kms.v1.ListImportJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListImportJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @static + * @param {google.cloud.kms.v1.ListImportJobsRequest} message ListImportJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImportJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; - return OneofOptions; - })(); + /** + * Converts this ListImportJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListImportJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListImportJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - protobuf.EnumOptions = (function() { + return ListImportJobsRequest; + })(); - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ + v1.ListKeyRingsResponse = (function() { - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListKeyRingsResponse. + * @memberof google.cloud.kms.v1 + * @interface IListKeyRingsResponse + * @property {Array.|null} [keyRings] ListKeyRingsResponse keyRings + * @property {string|null} [nextPageToken] ListKeyRingsResponse nextPageToken + * @property {number|null} [totalSize] ListKeyRingsResponse totalSize + */ - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; + /** + * Constructs a new ListKeyRingsResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListKeyRingsResponse. + * @implements IListKeyRingsResponse + * @constructor + * @param {google.cloud.kms.v1.IListKeyRingsResponse=} [properties] Properties to set + */ + function ListKeyRingsResponse(properties) { + this.keyRings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; + /** + * ListKeyRingsResponse keyRings. + * @member {Array.} keyRings + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @instance + */ + ListKeyRingsResponse.prototype.keyRings = $util.emptyArray; - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ListKeyRingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @instance + */ + ListKeyRingsResponse.prototype.nextPageToken = ""; - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; + /** + * ListKeyRingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @instance + */ + ListKeyRingsResponse.prototype.totalSize = 0; - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Creates a new ListKeyRingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {google.cloud.kms.v1.IListKeyRingsResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse instance + */ + ListKeyRingsResponse.create = function create(properties) { + return new ListKeyRingsResponse(properties); + }; + + /** + * Encodes the specified ListKeyRingsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {google.cloud.kms.v1.IListKeyRingsResponse} message ListKeyRingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeyRingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyRings != null && message.keyRings.length) + for (var i = 0; i < message.keyRings.length; ++i) + $root.google.cloud.kms.v1.KeyRing.encode(message.keyRings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListKeyRingsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListKeyRingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {google.cloud.kms.v1.IListKeyRingsResponse} message ListKeyRingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeyRingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ListKeyRingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeyRingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListKeyRingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keyRings && message.keyRings.length)) + message.keyRings = []; + message.keyRings.push($root.google.cloud.kms.v1.KeyRing.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListKeyRingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeyRingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Verifies a ListKeyRingsResponse message. + * @function verify + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeyRingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyRings != null && message.hasOwnProperty("keyRings")) { + if (!Array.isArray(message.keyRings)) + return "keyRings: array expected"; + for (var i = 0; i < message.keyRings.length; ++i) { + var error = $root.google.cloud.kms.v1.KeyRing.verify(message.keyRings[i]); + if (error) + return "keyRings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Creates a ListKeyRingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListKeyRingsResponse} ListKeyRingsResponse + */ + ListKeyRingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListKeyRingsResponse) + return object; + var message = new $root.google.cloud.kms.v1.ListKeyRingsResponse(); + if (object.keyRings) { + if (!Array.isArray(object.keyRings)) + throw TypeError(".google.cloud.kms.v1.ListKeyRingsResponse.keyRings: array expected"); + message.keyRings = []; + for (var i = 0; i < object.keyRings.length; ++i) { + if (typeof object.keyRings[i] !== "object") + throw TypeError(".google.cloud.kms.v1.ListKeyRingsResponse.keyRings: object expected"); + message.keyRings[i] = $root.google.cloud.kms.v1.KeyRing.fromObject(object.keyRings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListKeyRingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @static + * @param {google.cloud.kms.v1.ListKeyRingsResponse} message ListKeyRingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeyRingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keyRings = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.keyRings && message.keyRings.length) { + object.keyRings = []; + for (var j = 0; j < message.keyRings.length; ++j) + object.keyRings[j] = $root.google.cloud.kms.v1.KeyRing.toObject(message.keyRings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Converts this ListKeyRingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListKeyRingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListKeyRingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ListKeyRingsResponse; + })(); - return EnumOptions; - })(); + v1.ListCryptoKeysResponse = (function() { - protobuf.EnumValueOptions = (function() { + /** + * Properties of a ListCryptoKeysResponse. + * @memberof google.cloud.kms.v1 + * @interface IListCryptoKeysResponse + * @property {Array.|null} [cryptoKeys] ListCryptoKeysResponse cryptoKeys + * @property {string|null} [nextPageToken] ListCryptoKeysResponse nextPageToken + * @property {number|null} [totalSize] ListCryptoKeysResponse totalSize + */ - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ + /** + * Constructs a new ListCryptoKeysResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListCryptoKeysResponse. + * @implements IListCryptoKeysResponse + * @constructor + * @param {google.cloud.kms.v1.IListCryptoKeysResponse=} [properties] Properties to set + */ + function ListCryptoKeysResponse(properties) { + this.cryptoKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListCryptoKeysResponse cryptoKeys. + * @member {Array.} cryptoKeys + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @instance + */ + ListCryptoKeysResponse.prototype.cryptoKeys = $util.emptyArray; - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; + /** + * ListCryptoKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @instance + */ + ListCryptoKeysResponse.prototype.nextPageToken = ""; - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ListCryptoKeysResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @instance + */ + ListCryptoKeysResponse.prototype.totalSize = 0; - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; + /** + * Creates a new ListCryptoKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse instance + */ + ListCryptoKeysResponse.create = function create(properties) { + return new ListCryptoKeysResponse(properties); + }; - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListCryptoKeysResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysResponse} message ListCryptoKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKeys != null && message.cryptoKeys.length) + for (var i = 0; i < message.cryptoKeys.length; ++i) + $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListCryptoKeysResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeysResponse} message ListCryptoKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCryptoKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cryptoKeys && message.cryptoKeys.length)) + message.cryptoKeys = []; + message.cryptoKeys.push($root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ListCryptoKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a ListCryptoKeysResponse message. + * @function verify + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCryptoKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKeys != null && message.hasOwnProperty("cryptoKeys")) { + if (!Array.isArray(message.cryptoKeys)) + return "cryptoKeys: array expected"; + for (var i = 0; i < message.cryptoKeys.length; ++i) { + var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKeys[i]); + if (error) + return "cryptoKeys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Creates a ListCryptoKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListCryptoKeysResponse} ListCryptoKeysResponse + */ + ListCryptoKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeysResponse) + return object; + var message = new $root.google.cloud.kms.v1.ListCryptoKeysResponse(); + if (object.cryptoKeys) { + if (!Array.isArray(object.cryptoKeys)) + throw TypeError(".google.cloud.kms.v1.ListCryptoKeysResponse.cryptoKeys: array expected"); + message.cryptoKeys = []; + for (var i = 0; i < object.cryptoKeys.length; ++i) { + if (typeof object.cryptoKeys[i] !== "object") + throw TypeError(".google.cloud.kms.v1.ListCryptoKeysResponse.cryptoKeys: object expected"); + message.cryptoKeys[i] = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKeys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Creates a plain object from a ListCryptoKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @static + * @param {google.cloud.kms.v1.ListCryptoKeysResponse} message ListCryptoKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCryptoKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cryptoKeys = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.cryptoKeys && message.cryptoKeys.length) { + object.cryptoKeys = []; + for (var j = 0; j < message.cryptoKeys.length; ++j) + object.cryptoKeys[j] = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKeys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Converts this ListCryptoKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListCryptoKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListCryptoKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ListCryptoKeysResponse; + })(); - return EnumValueOptions; - })(); + v1.ListCryptoKeyVersionsResponse = (function() { - protobuf.ServiceOptions = (function() { + /** + * Properties of a ListCryptoKeyVersionsResponse. + * @memberof google.cloud.kms.v1 + * @interface IListCryptoKeyVersionsResponse + * @property {Array.|null} [cryptoKeyVersions] ListCryptoKeyVersionsResponse cryptoKeyVersions + * @property {string|null} [nextPageToken] ListCryptoKeyVersionsResponse nextPageToken + * @property {number|null} [totalSize] ListCryptoKeyVersionsResponse totalSize + */ - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - */ + /** + * Constructs a new ListCryptoKeyVersionsResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListCryptoKeyVersionsResponse. + * @implements IListCryptoKeyVersionsResponse + * @constructor + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse=} [properties] Properties to set + */ + function ListCryptoKeyVersionsResponse(properties) { + this.cryptoKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListCryptoKeyVersionsResponse cryptoKeyVersions. + * @member {Array.} cryptoKeyVersions + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @instance + */ + ListCryptoKeyVersionsResponse.prototype.cryptoKeyVersions = $util.emptyArray; - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; + /** + * ListCryptoKeyVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @instance + */ + ListCryptoKeyVersionsResponse.prototype.nextPageToken = ""; - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ListCryptoKeyVersionsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @instance + */ + ListCryptoKeyVersionsResponse.prototype.totalSize = 0; - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + /** + * Creates a new ListCryptoKeyVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse instance + */ + ListCryptoKeyVersionsResponse.create = function create(properties) { + return new ListCryptoKeyVersionsResponse(properties); + }; - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + /** + * Encodes the specified ListCryptoKeyVersionsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeyVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKeyVersions != null && message.cryptoKeyVersions.length) + for (var i = 0; i < message.cryptoKeyVersions.length; ++i) + $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; + /** + * Encodes the specified ListCryptoKeyVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {google.cloud.kms.v1.IListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCryptoKeyVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - return writer; - }; + /** + * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeyVersionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cryptoKeyVersions && message.cryptoKeyVersions.length)) + message.cryptoKeyVersions = []; + message.cryptoKeyVersions.push($root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCryptoKeyVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCryptoKeyVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCryptoKeyVersionsResponse message. + * @function verify + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCryptoKeyVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKeyVersions != null && message.hasOwnProperty("cryptoKeyVersions")) { + if (!Array.isArray(message.cryptoKeyVersions)) + return "cryptoKeyVersions: array expected"; + for (var i = 0; i < message.cryptoKeyVersions.length; ++i) { + var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersions[i]); + if (error) + return "cryptoKeyVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a ListCryptoKeyVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} ListCryptoKeyVersionsResponse + */ + ListCryptoKeyVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse) + return object; + var message = new $root.google.cloud.kms.v1.ListCryptoKeyVersionsResponse(); + if (object.cryptoKeyVersions) { + if (!Array.isArray(object.cryptoKeyVersions)) + throw TypeError(".google.cloud.kms.v1.ListCryptoKeyVersionsResponse.cryptoKeyVersions: array expected"); + message.cryptoKeyVersions = []; + for (var i = 0; i < object.cryptoKeyVersions.length; ++i) { + if (typeof object.cryptoKeyVersions[i] !== "object") + throw TypeError(".google.cloud.kms.v1.ListCryptoKeyVersionsResponse.cryptoKeyVersions: object expected"); + message.cryptoKeyVersions[i] = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a ListCryptoKeyVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @static + * @param {google.cloud.kms.v1.ListCryptoKeyVersionsResponse} message ListCryptoKeyVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCryptoKeyVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cryptoKeyVersions = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.cryptoKeyVersions && message.cryptoKeyVersions.length) { + object.cryptoKeyVersions = []; + for (var j = 0; j < message.cryptoKeyVersions.length; ++j) + object.cryptoKeyVersions[j] = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this ListCryptoKeyVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListCryptoKeyVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCryptoKeyVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - return null; - }; + return ListCryptoKeyVersionsResponse; + })(); - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; - }; + v1.ListImportJobsResponse = (function() { - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - return object; - }; + /** + * Properties of a ListImportJobsResponse. + * @memberof google.cloud.kms.v1 + * @interface IListImportJobsResponse + * @property {Array.|null} [importJobs] ListImportJobsResponse importJobs + * @property {string|null} [nextPageToken] ListImportJobsResponse nextPageToken + * @property {number|null} [totalSize] ListImportJobsResponse totalSize + */ - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new ListImportJobsResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a ListImportJobsResponse. + * @implements IListImportJobsResponse + * @constructor + * @param {google.cloud.kms.v1.IListImportJobsResponse=} [properties] Properties to set + */ + function ListImportJobsResponse(properties) { + this.importJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return ServiceOptions; - })(); + /** + * ListImportJobsResponse importJobs. + * @member {Array.} importJobs + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @instance + */ + ListImportJobsResponse.prototype.importJobs = $util.emptyArray; - protobuf.MethodOptions = (function() { + /** + * ListImportJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @instance + */ + ListImportJobsResponse.prototype.nextPageToken = ""; - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ + /** + * ListImportJobsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @instance + */ + ListImportJobsResponse.prototype.totalSize = 0; - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new ListImportJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {google.cloud.kms.v1.IListImportJobsResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse instance + */ + ListImportJobsResponse.create = function create(properties) { + return new ListImportJobsResponse(properties); + }; - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; + /** + * Encodes the specified ListImportJobsResponse message. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {google.cloud.kms.v1.IListImportJobsResponse} message ListImportJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImportJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.importJobs != null && message.importJobs.length) + for (var i = 0; i < message.importJobs.length; ++i) + $root.google.cloud.kms.v1.ImportJob.encode(message.importJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; + /** + * Encodes the specified ListImportJobsResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ListImportJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {google.cloud.kms.v1.IListImportJobsResponse} message ListImportJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImportJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Decodes a ListImportJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImportJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ListImportJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.importJobs && message.importJobs.length)) + message.importJobs = []; + message.importJobs.push($root.google.cloud.kms.v1.ImportJob.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; + /** + * Decodes a ListImportJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImportJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + /** + * Verifies a ListImportJobsResponse message. + * @function verify + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListImportJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.importJobs != null && message.hasOwnProperty("importJobs")) { + if (!Array.isArray(message.importJobs)) + return "importJobs: array expected"; + for (var i = 0; i < message.importJobs.length; ++i) { + var error = $root.google.cloud.kms.v1.ImportJob.verify(message.importJobs[i]); + if (error) + return "importJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; + /** + * Creates a ListImportJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ListImportJobsResponse} ListImportJobsResponse + */ + ListImportJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ListImportJobsResponse) + return object; + var message = new $root.google.cloud.kms.v1.ListImportJobsResponse(); + if (object.importJobs) { + if (!Array.isArray(object.importJobs)) + throw TypeError(".google.cloud.kms.v1.ListImportJobsResponse.importJobs: array expected"); + message.importJobs = []; + for (var i = 0; i < object.importJobs.length; ++i) { + if (typeof object.importJobs[i] !== "object") + throw TypeError(".google.cloud.kms.v1.ListImportJobsResponse.importJobs: object expected"); + message.importJobs[i] = $root.google.cloud.kms.v1.ImportJob.fromObject(object.importJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a ListImportJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @static + * @param {google.cloud.kms.v1.ListImportJobsResponse} message ListImportJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImportJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.importJobs = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.importJobs && message.importJobs.length) { + object.importJobs = []; + for (var j = 0; j < message.importJobs.length; ++j) + object.importJobs[j] = $root.google.cloud.kms.v1.ImportJob.toObject(message.importJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ListImportJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ListImportJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListImportJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return ListImportJobsResponse; + })(); - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v1.GetKeyRingRequest = (function() { - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - return null; - }; + /** + * Properties of a GetKeyRingRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetKeyRingRequest + * @property {string|null} [name] GetKeyRingRequest name + */ - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Constructs a new GetKeyRingRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetKeyRingRequest. + * @implements IGetKeyRingRequest + * @constructor + * @param {google.cloud.kms.v1.IGetKeyRingRequest=} [properties] Properties to set + */ + function GetKeyRingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - return message; - }; - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; + /** + * GetKeyRingRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @instance + */ + GetKeyRingRequest.prototype.name = ""; - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new GetKeyRingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {google.cloud.kms.v1.IGetKeyRingRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest instance + */ + GetKeyRingRequest.create = function create(properties) { + return new GetKeyRingRequest(properties); + }; - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); + /** + * Encodes the specified GetKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {google.cloud.kms.v1.IGetKeyRingRequest} message GetKeyRingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - return MethodOptions; - })(); + /** + * Encodes the specified GetKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetKeyRingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {google.cloud.kms.v1.IGetKeyRingRequest} message GetKeyRingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.UninterpretedOption = (function() { + /** + * Decodes a GetKeyRingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetKeyRingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ + /** + * Decodes a GetKeyRingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetKeyRingRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetKeyRingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetKeyRingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetKeyRingRequest} GetKeyRingRequest + */ + GetKeyRingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetKeyRingRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetKeyRingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetKeyRingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @static + * @param {google.cloud.kms.v1.GetKeyRingRequest} message GetKeyRingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetKeyRingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetKeyRingRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetKeyRingRequest + * @instance + * @returns {Object.} JSON object + */ + GetKeyRingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetKeyRingRequest; + })(); - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1.GetCryptoKeyRequest = (function() { - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; + /** + * Properties of a GetCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetCryptoKeyRequest + * @property {string|null} [name] GetCryptoKeyRequest name + */ - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; + /** + * Constructs a new GetCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetCryptoKeyRequest. + * @implements IGetCryptoKeyRequest + * @constructor + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest=} [properties] Properties to set + */ + function GetCryptoKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** + * GetCryptoKeyRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @instance + */ + GetCryptoKeyRequest.prototype.name = ""; - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates a new GetCryptoKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest instance + */ + GetCryptoKeyRequest.create = function create(properties) { + return new GetCryptoKeyRequest(properties); + }; - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; + /** + * Encodes the specified GetCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} message GetCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCryptoKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + /** + * Encodes the specified GetCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyRequest} message GetCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; + /** + * Decodes a GetCryptoKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCryptoKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetCryptoKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; + /** + * Decodes a GetCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; + /** + * Verifies a GetCryptoKeyRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCryptoKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetCryptoKeyRequest} GetCryptoKeyRequest + */ + GetCryptoKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetCryptoKeyRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetCryptoKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCryptoKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.GetCryptoKeyRequest} message GetCryptoKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCryptoKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this GetCryptoKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetCryptoKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetCryptoKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return GetCryptoKeyRequest; + })(); - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v1.GetCryptoKeyVersionRequest = (function() { - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; + /** + * Properties of a GetCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetCryptoKeyVersionRequest + * @property {string|null} [name] GetCryptoKeyVersionRequest name + */ - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + /** + * Constructs a new GetCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetCryptoKeyVersionRequest. + * @implements IGetCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest=} [properties] Properties to set + */ + function GetCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; + /** + * GetCryptoKeyVersionRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @instance + */ + GetCryptoKeyVersionRequest.prototype.name = ""; + + /** + * Creates a new GetCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest instance + */ + GetCryptoKeyVersionRequest.create = function create(properties) { + return new GetCryptoKeyVersionRequest(properties); + }; + + /** + * Encodes the specified GetCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IGetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a GetCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - UninterpretedOption.NamePart = (function() { + /** + * Verifies a GetCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ + /** + * Creates a GetCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetCryptoKeyVersionRequest} GetCryptoKeyVersionRequest + */ + GetCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetCryptoKeyVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a plain object from a GetCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.GetCryptoKeyVersionRequest} message GetCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; + /** + * Converts this GetCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; + return GetCryptoKeyVersionRequest; + })(); - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; + v1.GetPublicKeyRequest = (function() { + + /** + * Properties of a GetPublicKeyRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetPublicKeyRequest + * @property {string|null} [name] GetPublicKeyRequest name + */ + + /** + * Constructs a new GetPublicKeyRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetPublicKeyRequest. + * @implements IGetPublicKeyRequest + * @constructor + * @param {google.cloud.kms.v1.IGetPublicKeyRequest=} [properties] Properties to set + */ + function GetPublicKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @instance + */ + GetPublicKeyRequest.prototype.name = ""; - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; + /** + * Creates a new GetPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest instance + */ + GetPublicKeyRequest.create = function create(properties) { + return new GetPublicKeyRequest(properties); + }; - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified GetPublicKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetPublicKeyRequest} message GetPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified GetPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {google.cloud.kms.v1.IGetPublicKeyRequest} message GetPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; + return message; + }; - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a GetPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; + /** + * Verifies a GetPublicKeyRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPublicKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; + /** + * Creates a GetPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetPublicKeyRequest} GetPublicKeyRequest + */ + GetPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetPublicKeyRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; + /** + * Creates a plain object from a GetPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @static + * @param {google.cloud.kms.v1.GetPublicKeyRequest} message GetPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this GetPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return NamePart; - })(); + return GetPublicKeyRequest; + })(); - return UninterpretedOption; - })(); + v1.GetImportJobRequest = (function() { - protobuf.SourceCodeInfo = (function() { + /** + * Properties of a GetImportJobRequest. + * @memberof google.cloud.kms.v1 + * @interface IGetImportJobRequest + * @property {string|null} [name] GetImportJobRequest name + */ - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ + /** + * Constructs a new GetImportJobRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a GetImportJobRequest. + * @implements IGetImportJobRequest + * @constructor + * @param {google.cloud.kms.v1.IGetImportJobRequest=} [properties] Properties to set + */ + function GetImportJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * GetImportJobRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @instance + */ + GetImportJobRequest.prototype.name = ""; - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; + /** + * Creates a new GetImportJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {google.cloud.kms.v1.IGetImportJobRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest instance + */ + GetImportJobRequest.create = function create(properties) { + return new GetImportJobRequest(properties); + }; - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; + /** + * Encodes the specified GetImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {google.cloud.kms.v1.IGetImportJobRequest} message GetImportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetImportJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified GetImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.GetImportJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {google.cloud.kms.v1.IGetImportJobRequest} message GetImportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetImportJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a GetImportJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetImportJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.GetImportJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a GetImportJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetImportJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetImportJobRequest message. + * @function verify + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetImportJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a GetImportJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.GetImportJobRequest} GetImportJobRequest + */ + GetImportJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.GetImportJobRequest) + return object; + var message = new $root.google.cloud.kms.v1.GetImportJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; + /** + * Creates a plain object from a GetImportJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @static + * @param {google.cloud.kms.v1.GetImportJobRequest} message GetImportJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetImportJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; + /** + * Converts this GetImportJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.GetImportJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetImportJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; + return GetImportJobRequest; + })(); - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v1.CreateKeyRingRequest = (function() { - SourceCodeInfo.Location = (function() { + /** + * Properties of a CreateKeyRingRequest. + * @memberof google.cloud.kms.v1 + * @interface ICreateKeyRingRequest + * @property {string|null} [parent] CreateKeyRingRequest parent + * @property {string|null} [keyRingId] CreateKeyRingRequest keyRingId + * @property {google.cloud.kms.v1.IKeyRing|null} [keyRing] CreateKeyRingRequest keyRing + */ - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ + /** + * Constructs a new CreateKeyRingRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CreateKeyRingRequest. + * @implements ICreateKeyRingRequest + * @constructor + * @param {google.cloud.kms.v1.ICreateKeyRingRequest=} [properties] Properties to set + */ + function CreateKeyRingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * CreateKeyRingRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @instance + */ + CreateKeyRingRequest.prototype.parent = ""; - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; + /** + * CreateKeyRingRequest keyRingId. + * @member {string} keyRingId + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @instance + */ + CreateKeyRingRequest.prototype.keyRingId = ""; - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; + /** + * CreateKeyRingRequest keyRing. + * @member {google.cloud.kms.v1.IKeyRing|null|undefined} keyRing + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @instance + */ + CreateKeyRingRequest.prototype.keyRing = null; - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; + /** + * Creates a new CreateKeyRingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {google.cloud.kms.v1.ICreateKeyRingRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest instance + */ + CreateKeyRingRequest.create = function create(properties) { + return new CreateKeyRingRequest(properties); + }; - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; + /** + * Encodes the specified CreateKeyRingRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {google.cloud.kms.v1.ICreateKeyRingRequest} message CreateKeyRingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.keyRingId); + if (message.keyRing != null && message.hasOwnProperty("keyRing")) + $root.google.cloud.kms.v1.KeyRing.encode(message.keyRing, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + /** + * Encodes the specified CreateKeyRingRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateKeyRingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {google.cloud.kms.v1.ICreateKeyRingRequest} message CreateKeyRingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; + /** + * Decodes a CreateKeyRingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateKeyRingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.keyRingId = reader.string(); + break; + case 3: + message.keyRing = $root.google.cloud.kms.v1.KeyRing.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; + /** + * Decodes a CreateKeyRingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a CreateKeyRingRequest message. + * @function verify + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateKeyRingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) + if (!$util.isString(message.keyRingId)) + return "keyRingId: string expected"; + if (message.keyRing != null && message.hasOwnProperty("keyRing")) { + var error = $root.google.cloud.kms.v1.KeyRing.verify(message.keyRing); + if (error) + return "keyRing." + error; + } + return null; + }; - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a CreateKeyRingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CreateKeyRingRequest} CreateKeyRingRequest + */ + CreateKeyRingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CreateKeyRingRequest) + return object; + var message = new $root.google.cloud.kms.v1.CreateKeyRingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.keyRingId != null) + message.keyRingId = String(object.keyRingId); + if (object.keyRing != null) { + if (typeof object.keyRing !== "object") + throw TypeError(".google.cloud.kms.v1.CreateKeyRingRequest.keyRing: object expected"); + message.keyRing = $root.google.cloud.kms.v1.KeyRing.fromObject(object.keyRing); + } + return message; + }; + + /** + * Creates a plain object from a CreateKeyRingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @static + * @param {google.cloud.kms.v1.CreateKeyRingRequest} message CreateKeyRingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateKeyRingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.keyRingId = ""; + object.keyRing = null; } - } - return message; - }; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.keyRingId != null && message.hasOwnProperty("keyRingId")) + object.keyRingId = message.keyRingId; + if (message.keyRing != null && message.hasOwnProperty("keyRing")) + object.keyRing = $root.google.cloud.kms.v1.KeyRing.toObject(message.keyRing, options); + return object; + }; - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this CreateKeyRingRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CreateKeyRingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateKeyRingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; + return CreateKeyRingRequest; + })(); - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; + v1.CreateCryptoKeyRequest = (function() { - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + /** + * Properties of a CreateCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @interface ICreateCryptoKeyRequest + * @property {string|null} [parent] CreateCryptoKeyRequest parent + * @property {string|null} [cryptoKeyId] CreateCryptoKeyRequest cryptoKeyId + * @property {google.cloud.kms.v1.ICryptoKey|null} [cryptoKey] CreateCryptoKeyRequest cryptoKey + * @property {boolean|null} [skipInitialVersionCreation] CreateCryptoKeyRequest skipInitialVersionCreation + */ + + /** + * Constructs a new CreateCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CreateCryptoKeyRequest. + * @implements ICreateCryptoKeyRequest + * @constructor + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest=} [properties] Properties to set + */ + function CreateCryptoKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return object; - }; - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CreateCryptoKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @instance + */ + CreateCryptoKeyRequest.prototype.parent = ""; - return Location; - })(); + /** + * CreateCryptoKeyRequest cryptoKeyId. + * @member {string} cryptoKeyId + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @instance + */ + CreateCryptoKeyRequest.prototype.cryptoKeyId = ""; - return SourceCodeInfo; - })(); + /** + * CreateCryptoKeyRequest cryptoKey. + * @member {google.cloud.kms.v1.ICryptoKey|null|undefined} cryptoKey + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @instance + */ + CreateCryptoKeyRequest.prototype.cryptoKey = null; - protobuf.GeneratedCodeInfo = (function() { + /** + * CreateCryptoKeyRequest skipInitialVersionCreation. + * @member {boolean} skipInitialVersionCreation + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @instance + */ + CreateCryptoKeyRequest.prototype.skipInitialVersionCreation = false; - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ + /** + * Creates a new CreateCryptoKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest instance + */ + CreateCryptoKeyRequest.create = function create(properties) { + return new CreateCryptoKeyRequest(properties); + }; + + /** + * Encodes the specified CreateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} message CreateCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCryptoKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cryptoKeyId); + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipInitialVersionCreation); + return writer; + }; - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified CreateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyRequest} message CreateCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + /** + * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCryptoKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateCryptoKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.cryptoKeyId = reader.string(); + break; + case 3: + message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32()); + break; + case 5: + message.skipInitialVersionCreation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; + /** + * Decodes a CreateCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Verifies a CreateCryptoKeyRequest message. + * @function verify + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCryptoKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) + if (!$util.isString(message.cryptoKeyId)) + return "cryptoKeyId: string expected"; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) + if (typeof message.skipInitialVersionCreation !== "boolean") + return "skipInitialVersionCreation: boolean expected"; + return null; + }; - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a CreateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CreateCryptoKeyRequest} CreateCryptoKeyRequest + */ + CreateCryptoKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CreateCryptoKeyRequest) + return object; + var message = new $root.google.cloud.kms.v1.CreateCryptoKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cryptoKeyId != null) + message.cryptoKeyId = String(object.cryptoKeyId); + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.cloud.kms.v1.CreateCryptoKeyRequest.cryptoKey: object expected"); + message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKey); + } + if (object.skipInitialVersionCreation != null) + message.skipInitialVersionCreation = Boolean(object.skipInitialVersionCreation); + return message; + }; - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a CreateCryptoKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.CreateCryptoKeyRequest} message CreateCryptoKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCryptoKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.cryptoKeyId = ""; + object.cryptoKey = null; + object.skipInitialVersionCreation = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cryptoKeyId != null && message.hasOwnProperty("cryptoKeyId")) + object.cryptoKeyId = message.cryptoKeyId; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + object.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKey, options); + if (message.skipInitialVersionCreation != null && message.hasOwnProperty("skipInitialVersionCreation")) + object.skipInitialVersionCreation = message.skipInitialVersionCreation; + return object; + }; - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this CreateCryptoKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CreateCryptoKeyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCryptoKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; + return CreateCryptoKeyRequest; + })(); - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + v1.CreateCryptoKeyVersionRequest = (function() { + + /** + * Properties of a CreateCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface ICreateCryptoKeyVersionRequest + * @property {string|null} [parent] CreateCryptoKeyVersionRequest parent + * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [cryptoKeyVersion] CreateCryptoKeyVersionRequest cryptoKeyVersion + */ + + /** + * Constructs a new CreateCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CreateCryptoKeyVersionRequest. + * @implements ICreateCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest=} [properties] Properties to set + */ + function CreateCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; + /** + * CreateCryptoKeyVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @instance + */ + CreateCryptoKeyVersionRequest.prototype.parent = ""; - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CreateCryptoKeyVersionRequest cryptoKeyVersion. + * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} cryptoKeyVersion + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @instance + */ + CreateCryptoKeyVersionRequest.prototype.cryptoKeyVersion = null; - GeneratedCodeInfo.Annotation = (function() { + /** + * Creates a new CreateCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest instance + */ + CreateCryptoKeyVersionRequest.create = function create(properties) { + return new CreateCryptoKeyVersionRequest(properties); + }; - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ + /** + * Encodes the specified CreateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) + $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.ICreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) { + var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersion); + if (error) + return "cryptoKeyVersion." + error; + } + return null; + }; - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a CreateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} CreateCryptoKeyVersionRequest + */ + CreateCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.CreateCryptoKeyVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cryptoKeyVersion != null) { + if (typeof object.cryptoKeyVersion !== "object") + throw TypeError(".google.cloud.kms.v1.CreateCryptoKeyVersionRequest.cryptoKeyVersion: object expected"); + message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersion); + } + return message; + }; - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; + /** + * Creates a plain object from a CreateCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.CreateCryptoKeyVersionRequest} message CreateCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.cryptoKeyVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) + object.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersion, options); + return object; + }; - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; + /** + * Converts this CreateCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CreateCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + return CreateCryptoKeyVersionRequest; + })(); - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + v1.ImportCryptoKeyVersionRequest = (function() { - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; + /** + * Properties of an ImportCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IImportCryptoKeyVersionRequest + * @property {string|null} [parent] ImportCryptoKeyVersionRequest parent + * @property {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm|null} [algorithm] ImportCryptoKeyVersionRequest algorithm + * @property {string|null} [importJob] ImportCryptoKeyVersionRequest importJob + * @property {Uint8Array|null} [rsaAesWrappedKey] ImportCryptoKeyVersionRequest rsaAesWrappedKey + */ - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); + /** + * Constructs a new ImportCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an ImportCryptoKeyVersionRequest. + * @implements IImportCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest=} [properties] Properties to set + */ + function ImportCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ImportCryptoKeyVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + */ + ImportCryptoKeyVersionRequest.prototype.parent = ""; - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ImportCryptoKeyVersionRequest algorithm. + * @member {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} algorithm + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + */ + ImportCryptoKeyVersionRequest.prototype.algorithm = 0; - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ImportCryptoKeyVersionRequest importJob. + * @member {string} importJob + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + */ + ImportCryptoKeyVersionRequest.prototype.importJob = ""; - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; + /** + * ImportCryptoKeyVersionRequest rsaAesWrappedKey. + * @member {Uint8Array} rsaAesWrappedKey + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + */ + ImportCryptoKeyVersionRequest.prototype.rsaAesWrappedKey = $util.newBuffer([]); - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; + /** + * ImportCryptoKeyVersionRequest wrappedKeyMaterial. + * @member {"rsaAesWrappedKey"|undefined} wrappedKeyMaterial + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + */ + Object.defineProperty(ImportCryptoKeyVersionRequest.prototype, "wrappedKeyMaterial", { + get: $util.oneOfGetter($oneOfFields = ["rsaAesWrappedKey"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new ImportCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest instance + */ + ImportCryptoKeyVersionRequest.create = function create(properties) { + return new ImportCryptoKeyVersionRequest(properties); + }; - return Annotation; - })(); + /** + * Encodes the specified ImportCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); + if (message.importJob != null && message.hasOwnProperty("importJob")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.importJob); + if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.rsaAesWrappedKey); + return writer; + }; - return GeneratedCodeInfo; - })(); + /** + * Encodes the specified ImportCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.ImportCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.Duration = (function() { + /** + * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.algorithm = reader.int32(); + break; + case 4: + message.importJob = reader.string(); + break; + case 5: + message.rsaAesWrappedKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ + /** + * Decodes an ImportCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies an ImportCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 15: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 17: + case 12: + case 13: + break; + } + if (message.importJob != null && message.hasOwnProperty("importJob")) + if (!$util.isString(message.importJob)) + return "importJob: string expected"; + if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) { + properties.wrappedKeyMaterial = 1; + if (!(message.rsaAesWrappedKey && typeof message.rsaAesWrappedKey.length === "number" || $util.isString(message.rsaAesWrappedKey))) + return "rsaAesWrappedKey: buffer expected"; + } + return null; + }; - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates an ImportCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} ImportCryptoKeyVersionRequest + */ + ImportCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.ImportCryptoKeyVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.algorithm) { + case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "GOOGLE_SYMMETRIC_ENCRYPTION": + case 1: + message.algorithm = 1; + break; + case "RSA_SIGN_PSS_2048_SHA256": + case 2: + message.algorithm = 2; + break; + case "RSA_SIGN_PSS_3072_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_SIGN_PSS_4096_SHA256": + case 4: + message.algorithm = 4; + break; + case "RSA_SIGN_PSS_4096_SHA512": + case 15: + message.algorithm = 15; + break; + case "RSA_SIGN_PKCS1_2048_SHA256": + case 5: + message.algorithm = 5; + break; + case "RSA_SIGN_PKCS1_3072_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_SIGN_PKCS1_4096_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_SIGN_PKCS1_4096_SHA512": + case 16: + message.algorithm = 16; + break; + case "RSA_DECRYPT_OAEP_2048_SHA256": + case 8: + message.algorithm = 8; + break; + case "RSA_DECRYPT_OAEP_3072_SHA256": + case 9: + message.algorithm = 9; + break; + case "RSA_DECRYPT_OAEP_4096_SHA256": + case 10: + message.algorithm = 10; + break; + case "RSA_DECRYPT_OAEP_4096_SHA512": + case 17: + message.algorithm = 17; + break; + case "EC_SIGN_P256_SHA256": + case 12: + message.algorithm = 12; + break; + case "EC_SIGN_P384_SHA384": + case 13: + message.algorithm = 13; + break; + } + if (object.importJob != null) + message.importJob = String(object.importJob); + if (object.rsaAesWrappedKey != null) + if (typeof object.rsaAesWrappedKey === "string") + $util.base64.decode(object.rsaAesWrappedKey, message.rsaAesWrappedKey = $util.newBuffer($util.base64.length(object.rsaAesWrappedKey)), 0); + else if (object.rsaAesWrappedKey.length) + message.rsaAesWrappedKey = object.rsaAesWrappedKey; + return message; + }; - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; + /** + * Creates a plain object from an ImportCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.ImportCryptoKeyVersionRequest} message ImportCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; + object.importJob = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + if (message.importJob != null && message.hasOwnProperty("importJob")) + object.importJob = message.importJob; + if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) { + object.rsaAesWrappedKey = options.bytes === String ? $util.base64.encode(message.rsaAesWrappedKey, 0, message.rsaAesWrappedKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.rsaAesWrappedKey) : message.rsaAesWrappedKey; + if (options.oneofs) + object.wrappedKeyMaterial = "rsaAesWrappedKey"; + } + return object; + }; - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; + /** + * Converts this ImportCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.ImportCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + ImportCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; + return ImportCryptoKeyVersionRequest; + })(); - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.CreateImportJobRequest = (function() { - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a CreateImportJobRequest. + * @memberof google.cloud.kms.v1 + * @interface ICreateImportJobRequest + * @property {string|null} [parent] CreateImportJobRequest parent + * @property {string|null} [importJobId] CreateImportJobRequest importJobId + * @property {google.cloud.kms.v1.IImportJob|null} [importJob] CreateImportJobRequest importJob + */ - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new CreateImportJobRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a CreateImportJobRequest. + * @implements ICreateImportJobRequest + * @constructor + * @param {google.cloud.kms.v1.ICreateImportJobRequest=} [properties] Properties to set + */ + function CreateImportJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; + /** + * CreateImportJobRequest parent. + * @member {string} parent + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @instance + */ + CreateImportJobRequest.prototype.parent = ""; - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; + /** + * CreateImportJobRequest importJobId. + * @member {string} importJobId + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @instance + */ + CreateImportJobRequest.prototype.importJobId = ""; - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; + /** + * CreateImportJobRequest importJob. + * @member {google.cloud.kms.v1.IImportJob|null|undefined} importJob + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @instance + */ + CreateImportJobRequest.prototype.importJob = null; - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new CreateImportJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {google.cloud.kms.v1.ICreateImportJobRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest instance + */ + CreateImportJobRequest.create = function create(properties) { + return new CreateImportJobRequest(properties); + }; - return Duration; - })(); + /** + * Encodes the specified CreateImportJobRequest message. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {google.cloud.kms.v1.ICreateImportJobRequest} message CreateImportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateImportJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.importJobId != null && message.hasOwnProperty("importJobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.importJobId); + if (message.importJob != null && message.hasOwnProperty("importJob")) + $root.google.cloud.kms.v1.ImportJob.encode(message.importJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - protobuf.Timestamp = (function() { + /** + * Encodes the specified CreateImportJobRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.CreateImportJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {google.cloud.kms.v1.ICreateImportJobRequest} message CreateImportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateImportJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ + /** + * Decodes a CreateImportJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateImportJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.CreateImportJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.importJobId = reader.string(); + break; + case 3: + message.importJob = $root.google.cloud.kms.v1.ImportJob.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a CreateImportJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateImportJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Verifies a CreateImportJobRequest message. + * @function verify + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateImportJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.importJobId != null && message.hasOwnProperty("importJobId")) + if (!$util.isString(message.importJobId)) + return "importJobId: string expected"; + if (message.importJob != null && message.hasOwnProperty("importJob")) { + var error = $root.google.cloud.kms.v1.ImportJob.verify(message.importJob); + if (error) + return "importJob." + error; + } + return null; + }; - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; + /** + * Creates a CreateImportJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.CreateImportJobRequest} CreateImportJobRequest + */ + CreateImportJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.CreateImportJobRequest) + return object; + var message = new $root.google.cloud.kms.v1.CreateImportJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.importJobId != null) + message.importJobId = String(object.importJobId); + if (object.importJob != null) { + if (typeof object.importJob !== "object") + throw TypeError(".google.cloud.kms.v1.CreateImportJobRequest.importJob: object expected"); + message.importJob = $root.google.cloud.kms.v1.ImportJob.fromObject(object.importJob); + } + return message; + }; - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; + /** + * Creates a plain object from a CreateImportJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @static + * @param {google.cloud.kms.v1.CreateImportJobRequest} message CreateImportJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateImportJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importJobId = ""; + object.importJob = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.importJobId != null && message.hasOwnProperty("importJobId")) + object.importJobId = message.importJobId; + if (message.importJob != null && message.hasOwnProperty("importJob")) + object.importJob = $root.google.cloud.kms.v1.ImportJob.toObject(message.importJob, options); + return object; + }; - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; + /** + * Converts this CreateImportJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.CreateImportJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateImportJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return CreateImportJobRequest; + })(); - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.UpdateCryptoKeyRequest = (function() { - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an UpdateCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @interface IUpdateCryptoKeyRequest + * @property {google.cloud.kms.v1.ICryptoKey|null} [cryptoKey] UpdateCryptoKeyRequest cryptoKey + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCryptoKeyRequest updateMask + */ - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; + /** + * Constructs a new UpdateCryptoKeyRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an UpdateCryptoKeyRequest. + * @implements IUpdateCryptoKeyRequest + * @constructor + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest=} [properties] Properties to set + */ + function UpdateCryptoKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; + /** + * UpdateCryptoKeyRequest cryptoKey. + * @member {google.cloud.kms.v1.ICryptoKey|null|undefined} cryptoKey + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @instance + */ + UpdateCryptoKeyRequest.prototype.cryptoKey = null; - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; + /** + * UpdateCryptoKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @instance + */ + UpdateCryptoKeyRequest.prototype.updateMask = null; - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new UpdateCryptoKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest instance + */ + UpdateCryptoKeyRequest.create = function create(properties) { + return new UpdateCryptoKeyRequest(properties); + }; - return Timestamp; - })(); + /** + * Encodes the specified UpdateCryptoKeyRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} message UpdateCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + $root.google.cloud.kms.v1.CryptoKey.encode(message.cryptoKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - protobuf.FieldMask = (function() { + /** + * Encodes the specified UpdateCryptoKeyRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyRequest} message UpdateCryptoKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ + /** + * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an UpdateCryptoKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; + /** + * Verifies an UpdateCryptoKeyRequest message. + * @function verify + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCryptoKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) { + var error = $root.google.cloud.kms.v1.CryptoKey.verify(message.cryptoKey); + if (error) + return "cryptoKey." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; + /** + * Creates an UpdateCryptoKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.UpdateCryptoKeyRequest} UpdateCryptoKeyRequest + */ + UpdateCryptoKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyRequest) + return object; + var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyRequest(); + if (object.cryptoKey != null) { + if (typeof object.cryptoKey !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyRequest.cryptoKey: object expected"); + message.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.fromObject(object.cryptoKey); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCryptoKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @static + * @param {google.cloud.kms.v1.UpdateCryptoKeyRequest} message UpdateCryptoKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCryptoKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cryptoKey = null; + object.updateMask = null; + } + if (message.cryptoKey != null && message.hasOwnProperty("cryptoKey")) + object.cryptoKey = $root.google.cloud.kms.v1.CryptoKey.toObject(message.cryptoKey, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCryptoKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.UpdateCryptoKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCryptoKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; + return UpdateCryptoKeyRequest; + })(); - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.UpdateCryptoKeyVersionRequest = (function() { - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Properties of an UpdateCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IUpdateCryptoKeyVersionRequest + * @property {google.cloud.kms.v1.ICryptoKeyVersion|null} [cryptoKeyVersion] UpdateCryptoKeyVersionRequest cryptoKeyVersion + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCryptoKeyVersionRequest updateMask + */ + + /** + * Constructs a new UpdateCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an UpdateCryptoKeyVersionRequest. + * @implements IUpdateCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest=} [properties] Properties to set + */ + function UpdateCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * UpdateCryptoKeyVersionRequest cryptoKeyVersion. + * @member {google.cloud.kms.v1.ICryptoKeyVersion|null|undefined} cryptoKeyVersion + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @instance + */ + UpdateCryptoKeyVersionRequest.prototype.cryptoKeyVersion = null; - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; + /** + * UpdateCryptoKeyVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @instance + */ + UpdateCryptoKeyVersionRequest.prototype.updateMask = null; - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; + /** + * Creates a new UpdateCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest instance + */ + UpdateCryptoKeyVersionRequest.create = function create(properties) { + return new UpdateCryptoKeyVersionRequest(properties); + }; - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; + /** + * Encodes the specified UpdateCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) + $root.google.cloud.kms.v1.CryptoKeyVersion.encode(message.cryptoKeyVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified UpdateCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return FieldMask; - })(); + /** + * Decodes an UpdateCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return protobuf; - })(); + /** + * Verifies an UpdateCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) { + var error = $root.google.cloud.kms.v1.CryptoKeyVersion.verify(message.cryptoKeyVersion); + if (error) + return "cryptoKeyVersion." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - google.iam = (function() { + /** + * Creates an UpdateCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} UpdateCryptoKeyVersionRequest + */ + UpdateCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest(); + if (object.cryptoKeyVersion != null) { + if (typeof object.cryptoKeyVersion !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.cryptoKeyVersion: object expected"); + message.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.cryptoKeyVersion); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; + /** + * Creates a plain object from an UpdateCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.UpdateCryptoKeyVersionRequest} message UpdateCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cryptoKeyVersion = null; + object.updateMask = null; + } + if (message.cryptoKeyVersion != null && message.hasOwnProperty("cryptoKeyVersion")) + object.cryptoKeyVersion = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.cryptoKeyVersion, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - iam.v1 = (function() { + /** + * Converts this UpdateCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; + return UpdateCryptoKeyVersionRequest; + })(); - v1.IAMPolicy = (function() { + v1.EncryptRequest = (function() { - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Properties of an EncryptRequest. + * @memberof google.cloud.kms.v1 + * @interface IEncryptRequest + * @property {string|null} [name] EncryptRequest name + * @property {Uint8Array|null} [plaintext] EncryptRequest plaintext + * @property {Uint8Array|null} [additionalAuthenticatedData] EncryptRequest additionalAuthenticatedData + */ - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + /** + * Constructs a new EncryptRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an EncryptRequest. + * @implements IEncryptRequest + * @constructor + * @param {google.cloud.kms.v1.IEncryptRequest=} [properties] Properties to set + */ + function EncryptRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * EncryptRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.EncryptRequest + * @instance + */ + EncryptRequest.prototype.name = ""; - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ + /** + * EncryptRequest plaintext. + * @member {Uint8Array} plaintext + * @memberof google.cloud.kms.v1.EncryptRequest + * @instance + */ + EncryptRequest.prototype.plaintext = $util.newBuffer([]); - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + /** + * EncryptRequest additionalAuthenticatedData. + * @member {Uint8Array} additionalAuthenticatedData + * @memberof google.cloud.kms.v1.EncryptRequest + * @instance + */ + EncryptRequest.prototype.additionalAuthenticatedData = $util.newBuffer([]); - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new EncryptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {google.cloud.kms.v1.IEncryptRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest instance + */ + EncryptRequest.create = function create(properties) { + return new EncryptRequest(properties); + }; + + /** + * Encodes the specified EncryptRequest message. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {google.cloud.kms.v1.IEncryptRequest} message EncryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.plaintext); + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.additionalAuthenticatedData); + return writer; + }; - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ + /** + * Encodes the specified EncryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {google.cloud.kms.v1.IEncryptRequest} message EncryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + /** + * Decodes an EncryptRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.EncryptRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.plaintext = reader.bytes(); + break; + case 3: + message.additionalAuthenticatedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes an EncryptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ + /** + * Verifies an EncryptRequest message. + * @function verify + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) + return "plaintext: buffer expected"; + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + if (!(message.additionalAuthenticatedData && typeof message.additionalAuthenticatedData.length === "number" || $util.isString(message.additionalAuthenticatedData))) + return "additionalAuthenticatedData: buffer expected"; + return null; + }; - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + /** + * Creates an EncryptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.EncryptRequest} EncryptRequest + */ + EncryptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.EncryptRequest) + return object; + var message = new $root.google.cloud.kms.v1.EncryptRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.plaintext != null) + if (typeof object.plaintext === "string") + $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); + else if (object.plaintext.length) + message.plaintext = object.plaintext; + if (object.additionalAuthenticatedData != null) + if (typeof object.additionalAuthenticatedData === "string") + $util.base64.decode(object.additionalAuthenticatedData, message.additionalAuthenticatedData = $util.newBuffer($util.base64.length(object.additionalAuthenticatedData)), 0); + else if (object.additionalAuthenticatedData.length) + message.additionalAuthenticatedData = object.additionalAuthenticatedData; + return message; + }; - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from an EncryptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.EncryptRequest + * @static + * @param {google.cloud.kms.v1.EncryptRequest} message EncryptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.plaintext = ""; + else { + object.plaintext = []; + if (options.bytes !== Array) + object.plaintext = $util.newBuffer(object.plaintext); + } + if (options.bytes === String) + object.additionalAuthenticatedData = ""; + else { + object.additionalAuthenticatedData = []; + if (options.bytes !== Array) + object.additionalAuthenticatedData = $util.newBuffer(object.additionalAuthenticatedData); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + object.additionalAuthenticatedData = options.bytes === String ? $util.base64.encode(message.additionalAuthenticatedData, 0, message.additionalAuthenticatedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.additionalAuthenticatedData) : message.additionalAuthenticatedData; + return object; + }; - return IAMPolicy; - })(); + /** + * Converts this EncryptRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.EncryptRequest + * @instance + * @returns {Object.} JSON object + */ + EncryptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.SetIamPolicyRequest = (function() { + return EncryptRequest; + })(); - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - */ + v1.DecryptRequest = (function() { - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a DecryptRequest. + * @memberof google.cloud.kms.v1 + * @interface IDecryptRequest + * @property {string|null} [name] DecryptRequest name + * @property {Uint8Array|null} [ciphertext] DecryptRequest ciphertext + * @property {Uint8Array|null} [additionalAuthenticatedData] DecryptRequest additionalAuthenticatedData + */ + + /** + * Constructs a new DecryptRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a DecryptRequest. + * @implements IDecryptRequest + * @constructor + * @param {google.cloud.kms.v1.IDecryptRequest=} [properties] Properties to set + */ + function DecryptRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; + /** + * DecryptRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.DecryptRequest + * @instance + */ + DecryptRequest.prototype.name = ""; - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; + /** + * DecryptRequest ciphertext. + * @member {Uint8Array} ciphertext + * @memberof google.cloud.kms.v1.DecryptRequest + * @instance + */ + DecryptRequest.prototype.ciphertext = $util.newBuffer([]); - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; + /** + * DecryptRequest additionalAuthenticatedData. + * @member {Uint8Array} additionalAuthenticatedData + * @memberof google.cloud.kms.v1.DecryptRequest + * @instance + */ + DecryptRequest.prototype.additionalAuthenticatedData = $util.newBuffer([]); - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && message.hasOwnProperty("policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a new DecryptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {google.cloud.kms.v1.IDecryptRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest instance + */ + DecryptRequest.create = function create(properties) { + return new DecryptRequest(properties); + }; - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {google.cloud.kms.v1.IDecryptRequest} message DecryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecryptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ciphertext); + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.additionalAuthenticatedData); + return writer; + }; - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified DecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {google.cloud.kms.v1.IDecryptRequest} message DecryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecryptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecryptRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecryptRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DecryptRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.ciphertext = reader.bytes(); + break; + case 3: + message.additionalAuthenticatedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a DecryptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecryptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - return null; - }; + /** + * Verifies a DecryptRequest message. + * @function verify + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecryptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) + return "ciphertext: buffer expected"; + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + if (!(message.additionalAuthenticatedData && typeof message.additionalAuthenticatedData.length === "number" || $util.isString(message.additionalAuthenticatedData))) + return "additionalAuthenticatedData: buffer expected"; + return null; + }; - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + /** + * Creates a DecryptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.DecryptRequest} DecryptRequest + */ + DecryptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.DecryptRequest) + return object; + var message = new $root.google.cloud.kms.v1.DecryptRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ciphertext != null) + if (typeof object.ciphertext === "string") + $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); + else if (object.ciphertext.length) + message.ciphertext = object.ciphertext; + if (object.additionalAuthenticatedData != null) + if (typeof object.additionalAuthenticatedData === "string") + $util.base64.decode(object.additionalAuthenticatedData, message.additionalAuthenticatedData = $util.newBuffer($util.base64.length(object.additionalAuthenticatedData)), 0); + else if (object.additionalAuthenticatedData.length) + message.additionalAuthenticatedData = object.additionalAuthenticatedData; + return message; + }; + + /** + * Creates a plain object from a DecryptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.DecryptRequest + * @static + * @param {google.cloud.kms.v1.DecryptRequest} message DecryptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecryptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.ciphertext = ""; + else { + object.ciphertext = []; + if (options.bytes !== Array) + object.ciphertext = $util.newBuffer(object.ciphertext); + } + if (options.bytes === String) + object.additionalAuthenticatedData = ""; + else { + object.additionalAuthenticatedData = []; + if (options.bytes !== Array) + object.additionalAuthenticatedData = $util.newBuffer(object.additionalAuthenticatedData); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; + if (message.additionalAuthenticatedData != null && message.hasOwnProperty("additionalAuthenticatedData")) + object.additionalAuthenticatedData = options.bytes === String ? $util.base64.encode(message.additionalAuthenticatedData, 0, message.additionalAuthenticatedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.additionalAuthenticatedData) : message.additionalAuthenticatedData; return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - return message; - }; + }; - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - return object; - }; + /** + * Converts this DecryptRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.DecryptRequest + * @instance + * @returns {Object.} JSON object + */ + DecryptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return DecryptRequest; + })(); - return SetIamPolicyRequest; - })(); + v1.AsymmetricSignRequest = (function() { - v1.GetIamPolicyRequest = (function() { + /** + * Properties of an AsymmetricSignRequest. + * @memberof google.cloud.kms.v1 + * @interface IAsymmetricSignRequest + * @property {string|null} [name] AsymmetricSignRequest name + * @property {google.cloud.kms.v1.IDigest|null} [digest] AsymmetricSignRequest digest + */ - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - */ + /** + * Constructs a new AsymmetricSignRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an AsymmetricSignRequest. + * @implements IAsymmetricSignRequest + * @constructor + * @param {google.cloud.kms.v1.IAsymmetricSignRequest=} [properties] Properties to set + */ + function AsymmetricSignRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * AsymmetricSignRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @instance + */ + AsymmetricSignRequest.prototype.name = ""; - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; + /** + * AsymmetricSignRequest digest. + * @member {google.cloud.kms.v1.IDigest|null|undefined} digest + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @instance + */ + AsymmetricSignRequest.prototype.digest = null; - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; + /** + * Creates a new AsymmetricSignRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest instance + */ + AsymmetricSignRequest.create = function create(properties) { + return new AsymmetricSignRequest(properties); + }; - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - return writer; - }; + /** + * Encodes the specified AsymmetricSignRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignRequest} message AsymmetricSignRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricSignRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.digest != null && message.hasOwnProperty("digest")) + $root.google.cloud.kms.v1.Digest.encode(message.digest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AsymmetricSignRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignRequest} message AsymmetricSignRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricSignRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an AsymmetricSignRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricSignRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricSignRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.digest = $root.google.cloud.kms.v1.Digest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an AsymmetricSignRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricSignRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - return null; - }; + /** + * Verifies an AsymmetricSignRequest message. + * @function verify + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricSignRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.digest != null && message.hasOwnProperty("digest")) { + var error = $root.google.cloud.kms.v1.Digest.verify(message.digest); + if (error) + return "digest." + error; + } + return null; + }; - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - return message; - }; + /** + * Creates an AsymmetricSignRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.AsymmetricSignRequest} AsymmetricSignRequest + */ + AsymmetricSignRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.AsymmetricSignRequest) + return object; + var message = new $root.google.cloud.kms.v1.AsymmetricSignRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.digest != null) { + if (typeof object.digest !== "object") + throw TypeError(".google.cloud.kms.v1.AsymmetricSignRequest.digest: object expected"); + message.digest = $root.google.cloud.kms.v1.Digest.fromObject(object.digest); + } + return message; + }; - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - return object; - }; + /** + * Creates a plain object from an AsymmetricSignRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @static + * @param {google.cloud.kms.v1.AsymmetricSignRequest} message AsymmetricSignRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricSignRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.digest = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.digest != null && message.hasOwnProperty("digest")) + object.digest = $root.google.cloud.kms.v1.Digest.toObject(message.digest, options); + return object; + }; - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this AsymmetricSignRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.AsymmetricSignRequest + * @instance + * @returns {Object.} JSON object + */ + AsymmetricSignRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return GetIamPolicyRequest; - })(); + return AsymmetricSignRequest; + })(); - v1.TestIamPermissionsRequest = (function() { + v1.AsymmetricDecryptRequest = (function() { - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ + /** + * Properties of an AsymmetricDecryptRequest. + * @memberof google.cloud.kms.v1 + * @interface IAsymmetricDecryptRequest + * @property {string|null} [name] AsymmetricDecryptRequest name + * @property {Uint8Array|null} [ciphertext] AsymmetricDecryptRequest ciphertext + */ - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new AsymmetricDecryptRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an AsymmetricDecryptRequest. + * @implements IAsymmetricDecryptRequest + * @constructor + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest=} [properties] Properties to set + */ + function AsymmetricDecryptRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; + /** + * AsymmetricDecryptRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @instance + */ + AsymmetricDecryptRequest.prototype.name = ""; - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + /** + * AsymmetricDecryptRequest ciphertext. + * @member {Uint8Array} ciphertext + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @instance + */ + AsymmetricDecryptRequest.prototype.ciphertext = $util.newBuffer([]); - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; + /** + * Creates a new AsymmetricDecryptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest instance + */ + AsymmetricDecryptRequest.create = function create(properties) { + return new AsymmetricDecryptRequest(properties); + }; - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; + /** + * Encodes the specified AsymmetricDecryptRequest message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} message AsymmetricDecryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricDecryptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ciphertext); + return writer; + }; - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AsymmetricDecryptRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptRequest} message AsymmetricDecryptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricDecryptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricDecryptRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricDecryptRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.ciphertext = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an AsymmetricDecryptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricDecryptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsymmetricDecryptRequest message. + * @function verify + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricDecryptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) + return "ciphertext: buffer expected"; + return null; + }; - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; + /** + * Creates an AsymmetricDecryptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.AsymmetricDecryptRequest} AsymmetricDecryptRequest + */ + AsymmetricDecryptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.AsymmetricDecryptRequest) + return object; + var message = new $root.google.cloud.kms.v1.AsymmetricDecryptRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ciphertext != null) + if (typeof object.ciphertext === "string") + $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); + else if (object.ciphertext.length) + message.ciphertext = object.ciphertext; + return message; + }; - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + /** + * Creates a plain object from an AsymmetricDecryptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @static + * @param {google.cloud.kms.v1.AsymmetricDecryptRequest} message AsymmetricDecryptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricDecryptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.ciphertext = ""; + else { + object.ciphertext = []; + if (options.bytes !== Array) + object.ciphertext = $util.newBuffer(object.ciphertext); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; + }; - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this AsymmetricDecryptRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.AsymmetricDecryptRequest + * @instance + * @returns {Object.} JSON object + */ + AsymmetricDecryptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return TestIamPermissionsRequest; - })(); + return AsymmetricDecryptRequest; + })(); - v1.TestIamPermissionsResponse = (function() { + v1.DecryptResponse = (function() { - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ + /** + * Properties of a DecryptResponse. + * @memberof google.cloud.kms.v1 + * @interface IDecryptResponse + * @property {Uint8Array|null} [plaintext] DecryptResponse plaintext + */ - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new DecryptResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a DecryptResponse. + * @implements IDecryptResponse + * @constructor + * @param {google.cloud.kms.v1.IDecryptResponse=} [properties] Properties to set + */ + function DecryptResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + /** + * DecryptResponse plaintext. + * @member {Uint8Array} plaintext + * @memberof google.cloud.kms.v1.DecryptResponse + * @instance + */ + DecryptResponse.prototype.plaintext = $util.newBuffer([]); - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; + /** + * Creates a new DecryptResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {google.cloud.kms.v1.IDecryptResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse instance + */ + DecryptResponse.create = function create(properties) { + return new DecryptResponse(properties); + }; - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; + /** + * Encodes the specified DecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {google.cloud.kms.v1.IDecryptResponse} message DecryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecryptResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.plaintext); + return writer; + }; - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DecryptResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {google.cloud.kms.v1.IDecryptResponse} message DecryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecryptResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a DecryptResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecryptResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DecryptResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plaintext = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; + /** + * Decodes a DecryptResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecryptResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; + /** + * Verifies a DecryptResponse message. + * @function verify + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecryptResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) + return "plaintext: buffer expected"; + return null; + }; - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; + /** + * Creates a DecryptResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.DecryptResponse} DecryptResponse + */ + DecryptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.DecryptResponse) + return object; + var message = new $root.google.cloud.kms.v1.DecryptResponse(); + if (object.plaintext != null) + if (typeof object.plaintext === "string") + $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); + else if (object.plaintext.length) + message.plaintext = object.plaintext; + return message; + }; - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a DecryptResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.DecryptResponse + * @static + * @param {google.cloud.kms.v1.DecryptResponse} message DecryptResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecryptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.plaintext = ""; + else { + object.plaintext = []; + if (options.bytes !== Array) + object.plaintext = $util.newBuffer(object.plaintext); + } + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; + return object; + }; - return TestIamPermissionsResponse; - })(); + /** + * Converts this DecryptResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.DecryptResponse + * @instance + * @returns {Object.} JSON object + */ + DecryptResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.Policy = (function() { + return DecryptResponse; + })(); - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Uint8Array|null} [etag] Policy etag - */ + v1.EncryptResponse = (function() { - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an EncryptResponse. + * @memberof google.cloud.kms.v1 + * @interface IEncryptResponse + * @property {string|null} [name] EncryptResponse name + * @property {Uint8Array|null} [ciphertext] EncryptResponse ciphertext + */ - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; + /** + * Constructs a new EncryptResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an EncryptResponse. + * @implements IEncryptResponse + * @constructor + * @param {google.cloud.kms.v1.IEncryptResponse=} [properties] Properties to set + */ + function EncryptResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; + /** + * EncryptResponse name. + * @member {string} name + * @memberof google.cloud.kms.v1.EncryptResponse + * @instance + */ + EncryptResponse.prototype.name = ""; - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); + /** + * EncryptResponse ciphertext. + * @member {Uint8Array} ciphertext + * @memberof google.cloud.kms.v1.EncryptResponse + * @instance + */ + EncryptResponse.prototype.ciphertext = $util.newBuffer([]); - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; + /** + * Creates a new EncryptResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {google.cloud.kms.v1.IEncryptResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse instance + */ + EncryptResponse.create = function create(properties) { + return new EncryptResponse(properties); + }; - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && message.hasOwnProperty("etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified EncryptResponse message. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {google.cloud.kms.v1.IEncryptResponse} message EncryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ciphertext); + return writer; + }; - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EncryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.EncryptResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {google.cloud.kms.v1.IEncryptResponse} message EncryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an EncryptResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.EncryptResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.ciphertext = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; + + /** + * Decodes an EncryptResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies an EncryptResponse message. + * @function verify + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext))) + return "ciphertext: buffer expected"; + return null; + }; - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; + /** + * Creates an EncryptResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.EncryptResponse} EncryptResponse + */ + EncryptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.EncryptResponse) + return object; + var message = new $root.google.cloud.kms.v1.EncryptResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.ciphertext != null) + if (typeof object.ciphertext === "string") + $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0); + else if (object.ciphertext.length) + message.ciphertext = object.ciphertext; + return message; + }; - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + /** + * Creates a plain object from an EncryptResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.EncryptResponse + * @static + * @param {google.cloud.kms.v1.EncryptResponse} message EncryptResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.ciphertext = ""; + else { + object.ciphertext = []; + if (options.bytes !== Array) + object.ciphertext = $util.newBuffer(object.ciphertext); + } } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) - message.etag = object.etag; - return message; - }; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ciphertext != null && message.hasOwnProperty("ciphertext")) + object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext; + return object; + }; - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.bindings = []; - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - return object; - }; + /** + * Converts this EncryptResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.EncryptResponse + * @instance + * @returns {Object.} JSON object + */ + EncryptResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return EncryptResponse; + })(); - return Policy; - })(); + v1.AsymmetricSignResponse = (function() { - v1.Binding = (function() { + /** + * Properties of an AsymmetricSignResponse. + * @memberof google.cloud.kms.v1 + * @interface IAsymmetricSignResponse + * @property {Uint8Array|null} [signature] AsymmetricSignResponse signature + */ - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ + /** + * Constructs a new AsymmetricSignResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an AsymmetricSignResponse. + * @implements IAsymmetricSignResponse + * @constructor + * @param {google.cloud.kms.v1.IAsymmetricSignResponse=} [properties] Properties to set + */ + function AsymmetricSignResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AsymmetricSignResponse signature. + * @member {Uint8Array} signature + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @instance + */ + AsymmetricSignResponse.prototype.signature = $util.newBuffer([]); + + /** + * Creates a new AsymmetricSignResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse instance + */ + AsymmetricSignResponse.create = function create(properties) { + return new AsymmetricSignResponse(properties); + }; - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified AsymmetricSignResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignResponse} message AsymmetricSignResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricSignResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signature != null && message.hasOwnProperty("signature")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); + return writer; + }; - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; + /** + * Encodes the specified AsymmetricSignResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricSignResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricSignResponse} message AsymmetricSignResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricSignResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; + /** + * Decodes an AsymmetricSignResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricSignResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricSignResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; + /** + * Decodes an AsymmetricSignResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricSignResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; + /** + * Verifies an AsymmetricSignResponse message. + * @function verify + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricSignResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + return null; + }; - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates an AsymmetricSignResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.AsymmetricSignResponse} AsymmetricSignResponse + */ + AsymmetricSignResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.AsymmetricSignResponse) + return object; + var message = new $root.google.cloud.kms.v1.AsymmetricSignResponse(); + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + return message; + }; - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an AsymmetricSignResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @static + * @param {google.cloud.kms.v1.AsymmetricSignResponse} message AsymmetricSignResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricSignResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + return object; + }; - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this AsymmetricSignResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.AsymmetricSignResponse + * @instance + * @returns {Object.} JSON object + */ + AsymmetricSignResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return AsymmetricSignResponse; + })(); - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; + v1.AsymmetricDecryptResponse = (function() { - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; + /** + * Properties of an AsymmetricDecryptResponse. + * @memberof google.cloud.kms.v1 + * @interface IAsymmetricDecryptResponse + * @property {Uint8Array|null} [plaintext] AsymmetricDecryptResponse plaintext + */ - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; + /** + * Constructs a new AsymmetricDecryptResponse. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an AsymmetricDecryptResponse. + * @implements IAsymmetricDecryptResponse + * @constructor + * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse=} [properties] Properties to set + */ + function AsymmetricDecryptResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * AsymmetricDecryptResponse plaintext. + * @member {Uint8Array} plaintext + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @instance + */ + AsymmetricDecryptResponse.prototype.plaintext = $util.newBuffer([]); - return Binding; - })(); + /** + * Creates a new AsymmetricDecryptResponse instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse=} [properties] Properties to set + * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse instance + */ + AsymmetricDecryptResponse.create = function create(properties) { + return new AsymmetricDecryptResponse(properties); + }; - v1.PolicyDelta = (function() { + /** + * Encodes the specified AsymmetricDecryptResponse message. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse} message AsymmetricDecryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricDecryptResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.plaintext); + return writer; + }; - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ + /** + * Encodes the specified AsymmetricDecryptResponse message, length delimited. Does not implicitly {@link google.cloud.kms.v1.AsymmetricDecryptResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {google.cloud.kms.v1.IAsymmetricDecryptResponse} message AsymmetricDecryptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsymmetricDecryptResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricDecryptResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.AsymmetricDecryptResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plaintext = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + /** + * Decodes an AsymmetricDecryptResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsymmetricDecryptResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + /** + * Verifies an AsymmetricDecryptResponse message. + * @function verify + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsymmetricDecryptResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + if (!(message.plaintext && typeof message.plaintext.length === "number" || $util.isString(message.plaintext))) + return "plaintext: buffer expected"; + return null; + }; - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; + /** + * Creates an AsymmetricDecryptResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.AsymmetricDecryptResponse} AsymmetricDecryptResponse + */ + AsymmetricDecryptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.AsymmetricDecryptResponse) + return object; + var message = new $root.google.cloud.kms.v1.AsymmetricDecryptResponse(); + if (object.plaintext != null) + if (typeof object.plaintext === "string") + $util.base64.decode(object.plaintext, message.plaintext = $util.newBuffer($util.base64.length(object.plaintext)), 0); + else if (object.plaintext.length) + message.plaintext = object.plaintext; + return message; + }; - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from an AsymmetricDecryptResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @static + * @param {google.cloud.kms.v1.AsymmetricDecryptResponse} message AsymmetricDecryptResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsymmetricDecryptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.plaintext = ""; + else { + object.plaintext = []; + if (options.bytes !== Array) + object.plaintext = $util.newBuffer(object.plaintext); + } + if (message.plaintext != null && message.hasOwnProperty("plaintext")) + object.plaintext = options.bytes === String ? $util.base64.encode(message.plaintext, 0, message.plaintext.length) : options.bytes === Array ? Array.prototype.slice.call(message.plaintext) : message.plaintext; + return object; + }; - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this AsymmetricDecryptResponse to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.AsymmetricDecryptResponse + * @instance + * @returns {Object.} JSON object + */ + AsymmetricDecryptResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return AsymmetricDecryptResponse; + })(); - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v1.UpdateCryptoKeyPrimaryVersionRequest = (function() { - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; + /** + * Properties of an UpdateCryptoKeyPrimaryVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IUpdateCryptoKeyPrimaryVersionRequest + * @property {string|null} [name] UpdateCryptoKeyPrimaryVersionRequest name + * @property {string|null} [cryptoKeyVersionId] UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId + */ - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } + /** + * Constructs a new UpdateCryptoKeyPrimaryVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents an UpdateCryptoKeyPrimaryVersionRequest. + * @implements IUpdateCryptoKeyPrimaryVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest=} [properties] Properties to set + */ + function UpdateCryptoKeyPrimaryVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; + /** + * UpdateCryptoKeyPrimaryVersionRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @instance + */ + UpdateCryptoKeyPrimaryVersionRequest.prototype.name = ""; - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * UpdateCryptoKeyPrimaryVersionRequest cryptoKeyVersionId. + * @member {string} cryptoKeyVersionId + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @instance + */ + UpdateCryptoKeyPrimaryVersionRequest.prototype.cryptoKeyVersionId = ""; - return PolicyDelta; - })(); + /** + * Creates a new UpdateCryptoKeyPrimaryVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest instance + */ + UpdateCryptoKeyPrimaryVersionRequest.create = function create(properties) { + return new UpdateCryptoKeyPrimaryVersionRequest(properties); + }; - v1.BindingDelta = (function() { + /** + * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyPrimaryVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cryptoKeyVersionId); + return writer; + }; - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ + /** + * Encodes the specified UpdateCryptoKeyPrimaryVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCryptoKeyPrimaryVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyPrimaryVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.cryptoKeyVersionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; + /** + * Decodes an UpdateCryptoKeyPrimaryVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCryptoKeyPrimaryVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; + /** + * Verifies an UpdateCryptoKeyPrimaryVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCryptoKeyPrimaryVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) + if (!$util.isString(message.cryptoKeyVersionId)) + return "cryptoKeyVersionId: string expected"; + return null; + }; + + /** + * Creates an UpdateCryptoKeyPrimaryVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} UpdateCryptoKeyPrimaryVersionRequest + */ + UpdateCryptoKeyPrimaryVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.cryptoKeyVersionId != null) + message.cryptoKeyVersionId = String(object.cryptoKeyVersionId); + return message; + }; + + /** + * Creates a plain object from an UpdateCryptoKeyPrimaryVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @static + * @param {google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest} message UpdateCryptoKeyPrimaryVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCryptoKeyPrimaryVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.cryptoKeyVersionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.cryptoKeyVersionId != null && message.hasOwnProperty("cryptoKeyVersionId")) + object.cryptoKeyVersionId = message.cryptoKeyVersionId; + return object; + }; + + /** + * Converts this UpdateCryptoKeyPrimaryVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCryptoKeyPrimaryVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateCryptoKeyPrimaryVersionRequest; + })(); - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; + v1.DestroyCryptoKeyVersionRequest = (function() { - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; + /** + * Properties of a DestroyCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IDestroyCryptoKeyVersionRequest + * @property {string|null} [name] DestroyCryptoKeyVersionRequest name + */ - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; + /** + * Constructs a new DestroyCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a DestroyCryptoKeyVersionRequest. + * @implements IDestroyCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest=} [properties] Properties to set + */ + function DestroyCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && message.hasOwnProperty("member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * DestroyCryptoKeyVersionRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @instance + */ + DestroyCryptoKeyVersionRequest.prototype.name = ""; - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new DestroyCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest instance + */ + DestroyCryptoKeyVersionRequest.create = function create(properties) { + return new DestroyCryptoKeyVersionRequest(properties); + }; - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified DestroyCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified DestroyCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.DestroyCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; + /** + * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; + return message; + }; + + /** + * Decodes a DestroyCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroyCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroyCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; + /** + * Creates a DestroyCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} DestroyCryptoKeyVersionRequest + */ + DestroyCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; + /** + * Creates a plain object from a DestroyCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.DestroyCryptoKeyVersionRequest} message DestroyCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroyCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this DestroyCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DestroyCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; + return DestroyCryptoKeyVersionRequest; })(); - return BindingDelta; - })(); + v1.RestoreCryptoKeyVersionRequest = (function() { - v1.AuditConfigDelta = (function() { + /** + * Properties of a RestoreCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @interface IRestoreCryptoKeyVersionRequest + * @property {string|null} [name] RestoreCryptoKeyVersionRequest name + */ - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ + /** + * Constructs a new RestoreCryptoKeyVersionRequest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a RestoreCryptoKeyVersionRequest. + * @implements IRestoreCryptoKeyVersionRequest + * @constructor + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest=} [properties] Properties to set + */ + function RestoreCryptoKeyVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * RestoreCryptoKeyVersionRequest name. + * @member {string} name + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @instance + */ + RestoreCryptoKeyVersionRequest.prototype.name = ""; - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; + /** + * Creates a new RestoreCryptoKeyVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest instance + */ + RestoreCryptoKeyVersionRequest.create = function create(properties) { + return new RestoreCryptoKeyVersionRequest(properties); + }; - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; + /** + * Encodes the specified RestoreCryptoKeyVersionRequest message. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCryptoKeyVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified RestoreCryptoKeyVersionRequest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.RestoreCryptoKeyVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCryptoKeyVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; + /** + * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCryptoKeyVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; + /** + * Decodes a RestoreCryptoKeyVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCryptoKeyVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; + /** + * Verifies a RestoreCryptoKeyVersionRequest message. + * @function verify + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreCryptoKeyVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && message.hasOwnProperty("service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && message.hasOwnProperty("logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; + /** + * Creates a RestoreCryptoKeyVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} RestoreCryptoKeyVersionRequest + */ + RestoreCryptoKeyVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest) + return object; + var message = new $root.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a RestoreCryptoKeyVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @static + * @param {google.cloud.kms.v1.RestoreCryptoKeyVersionRequest} message RestoreCryptoKeyVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreCryptoKeyVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.service = reader.string(); - break; - case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this RestoreCryptoKeyVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreCryptoKeyVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return RestoreCryptoKeyVersionRequest; + })(); - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; + v1.Digest = (function() { + + /** + * Properties of a Digest. + * @memberof google.cloud.kms.v1 + * @interface IDigest + * @property {Uint8Array|null} [sha256] Digest sha256 + * @property {Uint8Array|null} [sha384] Digest sha384 + * @property {Uint8Array|null} [sha512] Digest sha512 + */ - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; + /** + * Constructs a new Digest. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a Digest. + * @implements IDigest + * @constructor + * @param {google.cloud.kms.v1.IDigest=} [properties] Properties to set + */ + function Digest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; + /** + * Digest sha256. + * @member {Uint8Array} sha256 + * @memberof google.cloud.kms.v1.Digest + * @instance + */ + Digest.prototype.sha256 = $util.newBuffer([]); - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Digest sha384. + * @member {Uint8Array} sha384 + * @memberof google.cloud.kms.v1.Digest + * @instance + */ + Digest.prototype.sha384 = $util.newBuffer([]); - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); + /** + * Digest sha512. + * @member {Uint8Array} sha512 + * @memberof google.cloud.kms.v1.Digest + * @instance + */ + Digest.prototype.sha512 = $util.newBuffer([]); - return AuditConfigDelta; - })(); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - return v1; - })(); + /** + * Digest digest. + * @member {"sha256"|"sha384"|"sha512"|undefined} digest + * @memberof google.cloud.kms.v1.Digest + * @instance + */ + Object.defineProperty(Digest.prototype, "digest", { + get: $util.oneOfGetter($oneOfFields = ["sha256", "sha384", "sha512"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Digest instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {google.cloud.kms.v1.IDigest=} [properties] Properties to set + * @returns {google.cloud.kms.v1.Digest} Digest instance + */ + Digest.create = function create(properties) { + return new Digest(properties); + }; + + /** + * Encodes the specified Digest message. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {google.cloud.kms.v1.IDigest} message Digest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Digest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sha256 != null && message.hasOwnProperty("sha256")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.sha256); + if (message.sha384 != null && message.hasOwnProperty("sha384")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sha384); + if (message.sha512 != null && message.hasOwnProperty("sha512")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.sha512); + return writer; + }; + + /** + * Encodes the specified Digest message, length delimited. Does not implicitly {@link google.cloud.kms.v1.Digest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {google.cloud.kms.v1.IDigest} message Digest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Digest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Digest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.Digest} Digest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Digest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.Digest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sha256 = reader.bytes(); + break; + case 2: + message.sha384 = reader.bytes(); + break; + case 3: + message.sha512 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Digest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.Digest} Digest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Digest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Digest message. + * @function verify + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Digest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sha256 != null && message.hasOwnProperty("sha256")) { + properties.digest = 1; + if (!(message.sha256 && typeof message.sha256.length === "number" || $util.isString(message.sha256))) + return "sha256: buffer expected"; + } + if (message.sha384 != null && message.hasOwnProperty("sha384")) { + if (properties.digest === 1) + return "digest: multiple values"; + properties.digest = 1; + if (!(message.sha384 && typeof message.sha384.length === "number" || $util.isString(message.sha384))) + return "sha384: buffer expected"; + } + if (message.sha512 != null && message.hasOwnProperty("sha512")) { + if (properties.digest === 1) + return "digest: multiple values"; + properties.digest = 1; + if (!(message.sha512 && typeof message.sha512.length === "number" || $util.isString(message.sha512))) + return "sha512: buffer expected"; + } + return null; + }; - return iam; - })(); + /** + * Creates a Digest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.Digest} Digest + */ + Digest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.Digest) + return object; + var message = new $root.google.cloud.kms.v1.Digest(); + if (object.sha256 != null) + if (typeof object.sha256 === "string") + $util.base64.decode(object.sha256, message.sha256 = $util.newBuffer($util.base64.length(object.sha256)), 0); + else if (object.sha256.length) + message.sha256 = object.sha256; + if (object.sha384 != null) + if (typeof object.sha384 === "string") + $util.base64.decode(object.sha384, message.sha384 = $util.newBuffer($util.base64.length(object.sha384)), 0); + else if (object.sha384.length) + message.sha384 = object.sha384; + if (object.sha512 != null) + if (typeof object.sha512 === "string") + $util.base64.decode(object.sha512, message.sha512 = $util.newBuffer($util.base64.length(object.sha512)), 0); + else if (object.sha512.length) + message.sha512 = object.sha512; + return message; + }; - google.type = (function() { + /** + * Creates a plain object from a Digest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.Digest + * @static + * @param {google.cloud.kms.v1.Digest} message Digest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Digest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sha256 != null && message.hasOwnProperty("sha256")) { + object.sha256 = options.bytes === String ? $util.base64.encode(message.sha256, 0, message.sha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256) : message.sha256; + if (options.oneofs) + object.digest = "sha256"; + } + if (message.sha384 != null && message.hasOwnProperty("sha384")) { + object.sha384 = options.bytes === String ? $util.base64.encode(message.sha384, 0, message.sha384.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha384) : message.sha384; + if (options.oneofs) + object.digest = "sha384"; + } + if (message.sha512 != null && message.hasOwnProperty("sha512")) { + object.sha512 = options.bytes === String ? $util.base64.encode(message.sha512, 0, message.sha512.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha512) : message.sha512; + if (options.oneofs) + object.digest = "sha512"; + } + return object; + }; - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; + /** + * Converts this Digest to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.Digest + * @instance + * @returns {Object.} JSON object + */ + Digest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - type.Expr = (function() { + return Digest; + })(); - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ + v1.LocationMetadata = (function() { - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.kms.v1 + * @interface ILocationMetadata + * @property {boolean|null} [hsmAvailable] LocationMetadata hsmAvailable + */ - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.kms.v1.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; + /** + * LocationMetadata hsmAvailable. + * @member {boolean} hsmAvailable + * @memberof google.cloud.kms.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.hsmAvailable = false; - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {google.cloud.kms.v1.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {google.cloud.kms.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.hsmAvailable); + return writer; + }; - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.kms.v1.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {google.cloud.kms.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && message.hasOwnProperty("expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && message.hasOwnProperty("title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && message.hasOwnProperty("location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hsmAvailable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) + if (typeof message.hsmAvailable !== "boolean") + return "hsmAvailable: boolean expected"; + return null; + }; - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.LocationMetadata) + return object; + var message = new $root.google.cloud.kms.v1.LocationMetadata(); + if (object.hsmAvailable != null) + message.hsmAvailable = Boolean(object.hsmAvailable); + return message; + }; - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.LocationMetadata + * @static + * @param {google.cloud.kms.v1.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.hsmAvailable = false; + if (message.hsmAvailable != null && message.hasOwnProperty("hsmAvailable")) + object.hsmAvailable = message.hsmAvailable; + return object; + }; - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; + return LocationMetadata; + })(); - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return v1; + })(); - return Expr; + return kms; })(); - return type; + return cloud; })(); return google; diff --git a/packages/google-cloud-kms/protos/protos.json b/packages/google-cloud-kms/protos/protos.json index ddf2d8c309a..89a32ed1f07 100644 --- a/packages/google-cloud-kms/protos/protos.json +++ b/packages/google-cloud-kms/protos/protos.json @@ -2,1283 +2,244 @@ "nested": { "google": { "nested": { - "cloud": { + "iam": { "nested": { - "kms": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "IamPolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, "nested": { - "v1": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "IAMPolicy": { "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Kms.V1", - "go_package": "google.golang.org/genproto/googleapis/cloud/kms/v1;kms", + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + } + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + } + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + } + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "logging": { + "options": { + "csharp_namespace": "Google.Cloud.Iam.V1.Logging", + "go_package": "google.golang.org/genproto/googleapis/iam/v1/logging;logging", "java_multiple_files": true, - "java_outer_classname": "KmsResourcesProto", - "java_package": "com.google.cloud.kms.v1", - "php_namespace": "Google\\Cloud\\Kms\\V1" + "java_outer_classname": "AuditDataProto", + "java_package": "com.google.iam.v1.logging" }, "nested": { - "KeyManagementService": { - "options": { - "(google.api.default_host)": "cloudkms.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkms" - }, - "methods": { - "ListKeyRings": { - "requestType": "ListKeyRingsRequest", - "responseType": "ListKeyRingsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/keyRings", - "(google.api.method_signature)": "parent" - } - }, - "ListCryptoKeys": { - "requestType": "ListCryptoKeysRequest", - "responseType": "ListCryptoKeysResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys", - "(google.api.method_signature)": "parent" - } - }, - "ListCryptoKeyVersions": { - "requestType": "ListCryptoKeyVersionsRequest", - "responseType": "ListCryptoKeyVersionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions", - "(google.api.method_signature)": "parent" - } - }, - "ListImportJobs": { - "requestType": "ListImportJobsRequest", - "responseType": "ListImportJobsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs", - "(google.api.method_signature)": "parent" - } - }, - "GetKeyRing": { - "requestType": "GetKeyRingRequest", - "responseType": "KeyRing", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*}", - "(google.api.method_signature)": "name" - } - }, - "GetCryptoKey": { - "requestType": "GetCryptoKeyRequest", - "responseType": "CryptoKey", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}", - "(google.api.method_signature)": "name" - } - }, - "GetCryptoKeyVersion": { - "requestType": "GetCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}", - "(google.api.method_signature)": "name" - } - }, - "GetPublicKey": { - "requestType": "GetPublicKeyRequest", - "responseType": "PublicKey", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey", - "(google.api.method_signature)": "name" - } - }, - "GetImportJob": { - "requestType": "GetImportJobRequest", - "responseType": "ImportJob", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}", - "(google.api.method_signature)": "name" - } - }, - "CreateKeyRing": { - "requestType": "CreateKeyRingRequest", - "responseType": "KeyRing", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/keyRings", - "(google.api.http).body": "key_ring", - "(google.api.method_signature)": "parent,key_ring_id,key_ring" - } - }, - "CreateCryptoKey": { - "requestType": "CreateCryptoKeyRequest", - "responseType": "CryptoKey", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys", - "(google.api.http).body": "crypto_key", - "(google.api.method_signature)": "parent,crypto_key_id,crypto_key" - } - }, - "CreateCryptoKeyVersion": { - "requestType": "CreateCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions", - "(google.api.http).body": "crypto_key_version", - "(google.api.method_signature)": "parent,crypto_key_version" - } - }, - "ImportCryptoKeyVersion": { - "requestType": "ImportCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import", - "(google.api.http).body": "*" - } - }, - "CreateImportJob": { - "requestType": "CreateImportJobRequest", - "responseType": "ImportJob", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs", - "(google.api.http).body": "import_job", - "(google.api.method_signature)": "parent,import_job_id,import_job" - } - }, - "UpdateCryptoKey": { - "requestType": "UpdateCryptoKeyRequest", - "responseType": "CryptoKey", - "options": { - "(google.api.http).patch": "/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}", - "(google.api.http).body": "crypto_key", - "(google.api.method_signature)": "crypto_key,update_mask" - } - }, - "UpdateCryptoKeyVersion": { - "requestType": "UpdateCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).patch": "/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}", - "(google.api.http).body": "crypto_key_version", - "(google.api.method_signature)": "crypto_key_version,update_mask" - } - }, - "Encrypt": { - "requestType": "EncryptRequest", - "responseType": "EncryptResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,plaintext" - } - }, - "Decrypt": { - "requestType": "DecryptRequest", - "responseType": "DecryptResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,ciphertext" - } - }, - "AsymmetricSign": { - "requestType": "AsymmetricSignRequest", - "responseType": "AsymmetricSignResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,digest" - } - }, - "AsymmetricDecrypt": { - "requestType": "AsymmetricDecryptRequest", - "responseType": "AsymmetricDecryptResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,ciphertext" - } - }, - "UpdateCryptoKeyPrimaryVersion": { - "requestType": "UpdateCryptoKeyPrimaryVersionRequest", - "responseType": "CryptoKey", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,crypto_key_version_id" - } - }, - "DestroyCryptoKeyVersion": { - "requestType": "DestroyCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - } - }, - "RestoreCryptoKeyVersion": { - "requestType": "RestoreCryptoKeyVersionRequest", - "responseType": "CryptoKeyVersion", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - } - } - } - }, - "ListKeyRingsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListCryptoKeysRequest": { + "AuditData": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "versionView": { - "type": "CryptoKeyVersion.CryptoKeyVersionView", - "id": 4 - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "policyDelta": { + "type": "google.iam.v1.PolicyDelta", + "id": 2 } } - }, - "ListCryptoKeyVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "view": { - "type": "CryptoKeyVersion.CryptoKeyVersionView", - "id": 4 - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListImportJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListKeyRingsResponse": { - "fields": { - "keyRings": { - "rule": "repeated", - "type": "KeyRing", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListCryptoKeysResponse": { - "fields": { - "cryptoKeys": { - "rule": "repeated", - "type": "CryptoKey", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListCryptoKeyVersionsResponse": { - "fields": { - "cryptoKeyVersions": { - "rule": "repeated", - "type": "CryptoKeyVersion", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "ListImportJobsResponse": { - "fields": { - "importJobs": { - "rule": "repeated", - "type": "ImportJob", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "GetKeyRingRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" - } - } - } - }, - "GetCryptoKeyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "GetCryptoKeyVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - } - }, - "GetPublicKeyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - } - }, - "GetImportJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/ImportJob" - } - } - } - }, - "CreateKeyRingRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "keyRingId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keyRing": { - "type": "KeyRing", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CreateCryptoKeyRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" - } - }, - "cryptoKeyId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cryptoKey": { - "type": "CryptoKey", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "skipInitialVersionCreation": { - "type": "bool", - "id": 5 - } - } - }, - "CreateCryptoKeyVersionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "cryptoKeyVersion": { - "type": "CryptoKeyVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ImportCryptoKeyVersionRequest": { - "oneofs": { - "wrappedKeyMaterial": { - "oneof": [ - "rsaAesWrappedKey" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "algorithm": { - "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "importJob": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "rsaAesWrappedKey": { - "type": "bytes", - "id": 5 - } - } - }, - "CreateImportJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" - } - }, - "importJobId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "importJob": { - "type": "ImportJob", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateCryptoKeyRequest": { - "fields": { - "cryptoKey": { - "type": "CryptoKey", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateCryptoKeyVersionRequest": { - "fields": { - "cryptoKeyVersion": { - "type": "CryptoKeyVersion", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "EncryptRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "plaintext": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "additionalAuthenticatedData": { - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DecryptRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "ciphertext": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "additionalAuthenticatedData": { - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AsymmetricSignRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - }, - "digest": { - "type": "Digest", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AsymmetricDecryptRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - }, - "ciphertext": { - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DecryptResponse": { - "fields": { - "plaintext": { - "type": "bytes", - "id": 1 - } - } - }, - "EncryptResponse": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "ciphertext": { - "type": "bytes", - "id": 2 - } - } - }, - "AsymmetricSignResponse": { - "fields": { - "signature": { - "type": "bytes", - "id": 1 - } - } - }, - "AsymmetricDecryptResponse": { - "fields": { - "plaintext": { - "type": "bytes", - "id": 1 - } - } - }, - "UpdateCryptoKeyPrimaryVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "cryptoKeyVersionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DestroyCryptoKeyVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - } - }, - "RestoreCryptoKeyVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - } - }, - "Digest": { - "oneofs": { - "digest": { - "oneof": [ - "sha256", - "sha384", - "sha512" - ] - } - }, - "fields": { - "sha256": { - "type": "bytes", - "id": 1 - }, - "sha384": { - "type": "bytes", - "id": 2 - }, - "sha512": { - "type": "bytes", - "id": 3 - } - } - }, - "LocationMetadata": { - "fields": { - "hsmAvailable": { - "type": "bool", - "id": 1 - } - } - }, - "KeyRing": { - "options": { - "(google.api.resource).type": "cloudkms.googleapis.com/KeyRing", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CryptoKey": { - "options": { - "(google.api.resource).type": "cloudkms.googleapis.com/CryptoKey", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" - }, - "oneofs": { - "rotationSchedule": { - "oneof": [ - "rotationPeriod" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "primary": { - "type": "CryptoKeyVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "purpose": { - "type": "CryptoKeyPurpose", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextRotationTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - }, - "rotationPeriod": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "versionTemplate": { - "type": "CryptoKeyVersionTemplate", - "id": 11 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 10 - } - }, - "nested": { - "CryptoKeyPurpose": { - "values": { - "CRYPTO_KEY_PURPOSE_UNSPECIFIED": 0, - "ENCRYPT_DECRYPT": 1, - "ASYMMETRIC_SIGN": 5, - "ASYMMETRIC_DECRYPT": 6 - } - } - } - }, - "CryptoKeyVersionTemplate": { - "fields": { - "protectionLevel": { - "type": "ProtectionLevel", - "id": 1 - }, - "algorithm": { - "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "KeyOperationAttestation": { - "fields": { - "format": { - "type": "AttestationFormat", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "content": { - "type": "bytes", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "AttestationFormat": { - "values": { - "ATTESTATION_FORMAT_UNSPECIFIED": 0, - "CAVIUM_V1_COMPRESSED": 3, - "CAVIUM_V2_COMPRESSED": 4 - } - } - } - }, - "CryptoKeyVersion": { - "options": { - "(google.api.resource).type": "cloudkms.googleapis.com/CryptoKeyVersion", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "CryptoKeyVersionState", - "id": 3 - }, - "protectionLevel": { - "type": "ProtectionLevel", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "algorithm": { - "type": "CryptoKeyVersionAlgorithm", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attestation": { - "type": "KeyOperationAttestation", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generateTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "destroyTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "destroyEventTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "importJob": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "importTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "importFailureReason": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "CryptoKeyVersionAlgorithm": { - "values": { - "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": 0, - "GOOGLE_SYMMETRIC_ENCRYPTION": 1, - "RSA_SIGN_PSS_2048_SHA256": 2, - "RSA_SIGN_PSS_3072_SHA256": 3, - "RSA_SIGN_PSS_4096_SHA256": 4, - "RSA_SIGN_PSS_4096_SHA512": 15, - "RSA_SIGN_PKCS1_2048_SHA256": 5, - "RSA_SIGN_PKCS1_3072_SHA256": 6, - "RSA_SIGN_PKCS1_4096_SHA256": 7, - "RSA_SIGN_PKCS1_4096_SHA512": 16, - "RSA_DECRYPT_OAEP_2048_SHA256": 8, - "RSA_DECRYPT_OAEP_3072_SHA256": 9, - "RSA_DECRYPT_OAEP_4096_SHA256": 10, - "RSA_DECRYPT_OAEP_4096_SHA512": 17, - "EC_SIGN_P256_SHA256": 12, - "EC_SIGN_P384_SHA384": 13 - } - }, - "CryptoKeyVersionState": { - "values": { - "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED": 0, - "PENDING_GENERATION": 5, - "ENABLED": 1, - "DISABLED": 2, - "DESTROYED": 3, - "DESTROY_SCHEDULED": 4, - "PENDING_IMPORT": 6, - "IMPORT_FAILED": 7 - } - }, - "CryptoKeyVersionView": { - "values": { - "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": 0, - "FULL": 1 - } - } - } - }, - "PublicKey": { - "fields": { - "pem": { - "type": "string", - "id": 1 - }, - "algorithm": { - "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", - "id": 2 - } - } - }, - "ImportJob": { - "options": { - "(google.api.resource).type": "cloudkms.googleapis.com/ImportJob", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "importMethod": { - "type": "ImportMethod", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "protectionLevel": { - "type": "ProtectionLevel", - "id": 9, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generateTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireEventTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "ImportJobState", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicKey": { - "type": "WrappingPublicKey", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attestation": { - "type": "KeyOperationAttestation", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "WrappingPublicKey": { - "fields": { - "pem": { - "type": "string", - "id": 1 - } - } - }, - "ImportMethod": { - "values": { - "IMPORT_METHOD_UNSPECIFIED": 0, - "RSA_OAEP_3072_SHA1_AES_256": 1, - "RSA_OAEP_4096_SHA1_AES_256": 2 - } - }, - "ImportJobState": { - "values": { - "IMPORT_JOB_STATE_UNSPECIFIED": 0, - "PENDING_GENERATION": 1, - "ACTIVE": 2, - "EXPIRED": 3 - } - } - } - }, - "ProtectionLevel": { - "values": { - "PROTECTION_LEVEL_UNSPECIFIED": 0, - "SOFTWARE": 1, - "HSM": 2, - "EXTERNAL": 3 - } } } } @@ -1286,6 +247,37 @@ } } }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, "api": { "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", @@ -2295,305 +1287,1396 @@ "type": "string", "id": 1 }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "cloud": { + "nested": { + "kms": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Kms.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/kms/v1;kms", + "java_multiple_files": true, + "java_outer_classname": "KmsProto", + "java_package": "com.google.cloud.kms.v1", + "php_namespace": "Google\\Cloud\\Kms\\V1" + }, + "nested": { + "KeyRing": { + "options": { + "(google.api.resource).type": "cloudkms.googleapis.com/KeyRing", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CryptoKey": { + "options": { + "(google.api.resource).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" + }, + "oneofs": { + "rotationSchedule": { + "oneof": [ + "rotationPeriod" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "primary": { + "type": "CryptoKeyVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "purpose": { + "type": "CryptoKeyPurpose", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextRotationTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "rotationPeriod": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "versionTemplate": { + "type": "CryptoKeyVersionTemplate", + "id": 11 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10 + } + }, + "nested": { + "CryptoKeyPurpose": { + "values": { + "CRYPTO_KEY_PURPOSE_UNSPECIFIED": 0, + "ENCRYPT_DECRYPT": 1, + "ASYMMETRIC_SIGN": 5, + "ASYMMETRIC_DECRYPT": 6 + } + } + } + }, + "CryptoKeyVersionTemplate": { + "fields": { + "protectionLevel": { + "type": "ProtectionLevel", + "id": 1 + }, + "algorithm": { + "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "KeyOperationAttestation": { + "fields": { + "format": { + "type": "AttestationFormat", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "content": { + "type": "bytes", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AttestationFormat": { + "values": { + "ATTESTATION_FORMAT_UNSPECIFIED": 0, + "CAVIUM_V1_COMPRESSED": 3, + "CAVIUM_V2_COMPRESSED": 4 + } + } + } + }, + "CryptoKeyVersion": { + "options": { + "(google.api.resource).type": "cloudkms.googleapis.com/CryptoKeyVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "CryptoKeyVersionState", + "id": 3 + }, + "protectionLevel": { + "type": "ProtectionLevel", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "algorithm": { + "type": "CryptoKeyVersionAlgorithm", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attestation": { + "type": "KeyOperationAttestation", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destroyTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destroyEventTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "importJob": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "importTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "importFailureReason": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "CryptoKeyVersionAlgorithm": { + "values": { + "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": 0, + "GOOGLE_SYMMETRIC_ENCRYPTION": 1, + "RSA_SIGN_PSS_2048_SHA256": 2, + "RSA_SIGN_PSS_3072_SHA256": 3, + "RSA_SIGN_PSS_4096_SHA256": 4, + "RSA_SIGN_PSS_4096_SHA512": 15, + "RSA_SIGN_PKCS1_2048_SHA256": 5, + "RSA_SIGN_PKCS1_3072_SHA256": 6, + "RSA_SIGN_PKCS1_4096_SHA256": 7, + "RSA_SIGN_PKCS1_4096_SHA512": 16, + "RSA_DECRYPT_OAEP_2048_SHA256": 8, + "RSA_DECRYPT_OAEP_3072_SHA256": 9, + "RSA_DECRYPT_OAEP_4096_SHA256": 10, + "RSA_DECRYPT_OAEP_4096_SHA512": 17, + "EC_SIGN_P256_SHA256": 12, + "EC_SIGN_P384_SHA384": 13 + } + }, + "CryptoKeyVersionState": { + "values": { + "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED": 0, + "PENDING_GENERATION": 5, + "ENABLED": 1, + "DISABLED": 2, + "DESTROYED": 3, + "DESTROY_SCHEDULED": 4, + "PENDING_IMPORT": 6, + "IMPORT_FAILED": 7 + } + }, + "CryptoKeyVersionView": { + "values": { + "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": 0, + "FULL": 1 + } + } + } + }, + "PublicKey": { + "fields": { + "pem": { + "type": "string", + "id": 1 + }, + "algorithm": { + "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", + "id": 2 + } + } + }, + "ImportJob": { + "options": { + "(google.api.resource).type": "cloudkms.googleapis.com/ImportJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "importMethod": { + "type": "ImportMethod", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "protectionLevel": { + "type": "ProtectionLevel", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireEventTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "ImportJobState", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicKey": { + "type": "WrappingPublicKey", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attestation": { + "type": "KeyOperationAttestation", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "WrappingPublicKey": { + "fields": { + "pem": { + "type": "string", + "id": 1 + } + } + }, + "ImportMethod": { + "values": { + "IMPORT_METHOD_UNSPECIFIED": 0, + "RSA_OAEP_3072_SHA1_AES_256": 1, + "RSA_OAEP_4096_SHA1_AES_256": 2 + } + }, + "ImportJobState": { + "values": { + "IMPORT_JOB_STATE_UNSPECIFIED": 0, + "PENDING_GENERATION": 1, + "ACTIVE": 2, + "EXPIRED": 3 + } + } + } + }, + "ProtectionLevel": { + "values": { + "PROTECTION_LEVEL_UNSPECIFIED": 0, + "SOFTWARE": 1, + "HSM": 2, + "EXTERNAL": 3 + } + }, + "KeyManagementService": { + "options": { + "(google.api.default_host)": "cloudkms.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkms" + }, + "methods": { + "ListKeyRings": { + "requestType": "ListKeyRingsRequest", + "responseType": "ListKeyRingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/keyRings", + "(google.api.method_signature)": "parent" + } + }, + "ListCryptoKeys": { + "requestType": "ListCryptoKeysRequest", + "responseType": "ListCryptoKeysResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys", + "(google.api.method_signature)": "parent" + } + }, + "ListCryptoKeyVersions": { + "requestType": "ListCryptoKeyVersionsRequest", + "responseType": "ListCryptoKeyVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions", + "(google.api.method_signature)": "parent" + } + }, + "ListImportJobs": { + "requestType": "ListImportJobsRequest", + "responseType": "ListImportJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs", + "(google.api.method_signature)": "parent" + } + }, + "GetKeyRing": { + "requestType": "GetKeyRingRequest", + "responseType": "KeyRing", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*}", + "(google.api.method_signature)": "name" + } + }, + "GetCryptoKey": { + "requestType": "GetCryptoKeyRequest", + "responseType": "CryptoKey", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}", + "(google.api.method_signature)": "name" + } + }, + "GetCryptoKeyVersion": { + "requestType": "GetCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}", + "(google.api.method_signature)": "name" + } + }, + "GetPublicKey": { + "requestType": "GetPublicKeyRequest", + "responseType": "PublicKey", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey", + "(google.api.method_signature)": "name" + } + }, + "GetImportJob": { + "requestType": "GetImportJobRequest", + "responseType": "ImportJob", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}", + "(google.api.method_signature)": "name" + } + }, + "CreateKeyRing": { + "requestType": "CreateKeyRingRequest", + "responseType": "KeyRing", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/keyRings", + "(google.api.http).body": "key_ring", + "(google.api.method_signature)": "parent,key_ring_id,key_ring" + } + }, + "CreateCryptoKey": { + "requestType": "CreateCryptoKeyRequest", + "responseType": "CryptoKey", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys", + "(google.api.http).body": "crypto_key", + "(google.api.method_signature)": "parent,crypto_key_id,crypto_key" + } + }, + "CreateCryptoKeyVersion": { + "requestType": "CreateCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions", + "(google.api.http).body": "crypto_key_version", + "(google.api.method_signature)": "parent,crypto_key_version" + } + }, + "ImportCryptoKeyVersion": { + "requestType": "ImportCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import", + "(google.api.http).body": "*" + } + }, + "CreateImportJob": { + "requestType": "CreateImportJobRequest", + "responseType": "ImportJob", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs", + "(google.api.http).body": "import_job", + "(google.api.method_signature)": "parent,import_job_id,import_job" + } + }, + "UpdateCryptoKey": { + "requestType": "UpdateCryptoKeyRequest", + "responseType": "CryptoKey", + "options": { + "(google.api.http).patch": "/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}", + "(google.api.http).body": "crypto_key", + "(google.api.method_signature)": "crypto_key,update_mask" + } + }, + "UpdateCryptoKeyVersion": { + "requestType": "UpdateCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).patch": "/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}", + "(google.api.http).body": "crypto_key_version", + "(google.api.method_signature)": "crypto_key_version,update_mask" + } + }, + "Encrypt": { + "requestType": "EncryptRequest", + "responseType": "EncryptResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,plaintext" + } + }, + "Decrypt": { + "requestType": "DecryptRequest", + "responseType": "DecryptResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,ciphertext" + } + }, + "AsymmetricSign": { + "requestType": "AsymmetricSignRequest", + "responseType": "AsymmetricSignResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,digest" + } + }, + "AsymmetricDecrypt": { + "requestType": "AsymmetricDecryptRequest", + "responseType": "AsymmetricDecryptResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,ciphertext" + } + }, + "UpdateCryptoKeyPrimaryVersion": { + "requestType": "UpdateCryptoKeyPrimaryVersionRequest", + "responseType": "CryptoKey", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,crypto_key_version_id" + } + }, + "DestroyCryptoKeyVersion": { + "requestType": "DestroyCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + } + }, + "RestoreCryptoKeyVersion": { + "requestType": "RestoreCryptoKeyVersionRequest", + "responseType": "CryptoKeyVersion", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + } + } + } + }, + "ListKeyRingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCryptoKeysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versionView": { + "type": "CryptoKeyVersion.CryptoKeyVersionView", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCryptoKeyVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "CryptoKeyVersion.CryptoKeyVersionView", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListImportJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListKeyRingsResponse": { + "fields": { + "keyRings": { + "rule": "repeated", + "type": "KeyRing", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListCryptoKeysResponse": { + "fields": { + "cryptoKeys": { + "rule": "repeated", + "type": "CryptoKey", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 + "ListCryptoKeyVersionsResponse": { + "fields": { + "cryptoKeyVersions": { + "rule": "repeated", + "type": "CryptoKeyVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } }, - "leadingComments": { - "type": "string", - "id": 3 + "ListImportJobsResponse": { + "fields": { + "importJobs": { + "rule": "repeated", + "type": "ImportJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } }, - "trailingComments": { - "type": "string", - "id": 4 + "GetKeyRingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" + } + } + } }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 + "GetCryptoKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } }, - "sourceFile": { - "type": "string", - "id": 2 + "GetCryptoKeyVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + } }, - "begin": { - "type": "int32", - "id": 3 + "GetPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + } + }, + "GetImportJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/ImportJob" + } + } + } + }, + "CreateKeyRingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "keyRingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keyRing": { + "type": "KeyRing", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateCryptoKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" + } + }, + "cryptoKeyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cryptoKey": { + "type": "CryptoKey", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "skipInitialVersionCreation": { + "type": "bool", + "id": 5 + } + } + }, + "CreateCryptoKeyVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "cryptoKeyVersion": { + "type": "CryptoKeyVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportCryptoKeyVersionRequest": { + "oneofs": { + "wrappedKeyMaterial": { + "oneof": [ + "rsaAesWrappedKey" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "algorithm": { + "type": "CryptoKeyVersion.CryptoKeyVersionAlgorithm", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "importJob": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rsaAesWrappedKey": { + "type": "bytes", + "id": 5 + } + } }, - "end": { - "type": "int32", - "id": 4 - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" + "CreateImportJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/KeyRing" + } + }, + "importJobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "importJob": { + "type": "ImportJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" + "UpdateCryptoKeyRequest": { + "fields": { + "cryptoKey": { + "type": "CryptoKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" + "UpdateCryptoKeyVersionRequest": { + "fields": { + "cryptoKeyVersion": { + "type": "CryptoKeyVersion", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1 }, - "policy": { - "type": "Policy", - "id": 2 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1 + "EncryptRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "plaintext": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "additionalAuthenticatedData": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 + "DecryptRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "ciphertext": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "additionalAuthenticatedData": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 + "AsymmetricSignRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "digest": { + "type": "Digest", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 + "AsymmetricDecryptRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "ciphertext": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 + "DecryptResponse": { + "fields": { + "plaintext": { + "type": "bytes", + "id": 1 + } + } }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 + "EncryptResponse": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ciphertext": { + "type": "bytes", + "id": 2 + } + } }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 + "AsymmetricSignResponse": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + } + } }, - "role": { - "type": "string", - "id": 2 + "AsymmetricDecryptResponse": { + "fields": { + "plaintext": { + "type": "bytes", + "id": 1 + } + } }, - "member": { - "type": "string", - "id": 3 + "UpdateCryptoKeyPrimaryVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "cryptoKeyVersionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 + "DestroyCryptoKeyVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 }, - "service": { - "type": "string", - "id": 2 + "RestoreCryptoKeyVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + } }, - "exemptedMember": { - "type": "string", - "id": 3 + "Digest": { + "oneofs": { + "digest": { + "oneof": [ + "sha256", + "sha384", + "sha512" + ] + } + }, + "fields": { + "sha256": { + "type": "bytes", + "id": 1 + }, + "sha384": { + "type": "bytes", + "id": 2 + }, + "sha512": { + "type": "bytes", + "id": 3 + } + } }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 + "LocationMetadata": { + "fields": { + "hsmAvailable": { + "type": "bool", + "id": 1 + } } } } @@ -2601,37 +2684,6 @@ } } } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } } } } diff --git a/packages/google-cloud-kms/src/extra_proto_list.json b/packages/google-cloud-kms/src/extra_proto_list.json new file mode 100644 index 00000000000..c742ed95e9e --- /dev/null +++ b/packages/google-cloud-kms/src/extra_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/iam/v1/policy.proto", + "../../protos/google/iam/v1/options.proto", + "../../protos/google/iam/v1/iam_policy.proto" + ] diff --git a/packages/google-cloud-kms/src/helper.ts b/packages/google-cloud-kms/src/helper.ts new file mode 100644 index 00000000000..5b6c5731650 --- /dev/null +++ b/packages/google-cloud-kms/src/helper.ts @@ -0,0 +1,260 @@ +// Copyright 2019 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 gax from 'google-gax'; +import {Descriptors, ClientOptions} from 'google-gax'; +import * as path from 'path'; +import * as gapicConfig from './iam_policy_service_client_config.json'; +import {ProjectIdCallback} from 'google-auth-library'; +import * as protosTypes from '../protos/protos'; +const {version} = require('../../package.json'); +/** + * Google Cloud IAM Client. + * This is manually written for providing methods [setIamPolicy, getIamPolicy, testIamPerssion] to the KMS client. + * We don't support it now in micro-generators. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + */ +export class IamClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function} = {}; + private _terminated = false; + auth: gax.GoogleAuth; + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof IamClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof IamClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + const nodejsProtoPath = path.join(__dirname, '..', 'protos', 'protos.json'); + + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../protos/protos.json') : nodejsProtoPath + ); + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.iam.v1.IAMPolicy', + gapicConfig as gax.ClientConfig, + opts!.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + // Put together the "service stub" for + // google.iam.v1.IAMPolicy. + const iamPolicyStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService('google.iam.v1.IAMPolicy') + : // tslint:disable-next-line no-any + (protos as any).google.iam.v1.IAMPolicy, + opts + ) as Promise<{[method: string]: Function}>; + this._innerApiCalls = {}; + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const iamPolicyStubMethods = [ + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + + for (const methodName of iamPolicyStubMethods) { + const innerCallPromise = iamPolicyStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudkms.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudkms.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + } + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback: ProjectIdCallback) { + return this.auth.getProjectId(callback); + } + + getIamPolicy(request: protosTypes.google.iam.v1.GetIamPolicyRequest): void; + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy(request: protosTypes.google.iam.v1.SetIamPolicyRequest): void; + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest + ): void; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + + return this._innerApiCalls.testIamPermissions(request, options, callback); + } +} +export interface IamClient { + getIamPolicy(request: protosTypes.google.iam.v1.GetIamPolicyRequest): void; + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ): Promise; + setIamPolicy(request: protosTypes.google.iam.v1.SetIamPolicyRequest): void; + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ): Promise; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest + ): void; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ): Promise; +} diff --git a/packages/google-cloud-kms/src/iam_policy_service_client_config.json b/packages/google-cloud-kms/src/iam_policy_service_client_config.json new file mode 100644 index 00000000000..a0aaf279aa6 --- /dev/null +++ b/packages/google-cloud-kms/src/iam_policy_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.iam.v1.IAMPolicy": { + "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": 20000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } + } + \ No newline at end of file diff --git a/packages/google-cloud-kms/src/index.js b/packages/google-cloud-kms/src/index.js deleted file mode 100644 index 7b482efe2d6..00000000000 --- a/packages/google-cloud-kms/src/index.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2018 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. - -/** - * @namespace google - */ -/** - * @namespace google.cloud - */ -/** - * @namespace google.cloud.kms - */ -/** - * @namespace google.cloud.kms.v1 - */ -/** - * @namespace google.protobuf - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1: require('./v1'), -}); - -/** - * The `@google-cloud/kms` package has the following named exports: - * - * - `KeyManagementServiceClient` - Reference to - * {@link v1.KeyManagementServiceClient} - * - `v1` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `KeyManagementServiceClient` - Reference to - * {@link v1.KeyManagementServiceClient} - * - * @module {object} @google-cloud/kms - * @alias nodejs-kms - * - * @example Install the client library with npm: - * npm install --save @google-cloud/kms - * - * @example Import the client library: - * const kms = require('@google-cloud/kms'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new kms.KeyManagementServiceClient(); - * - * @example Create a client with explicit credentials: - * const client = new kms.KeyManagementServiceClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} KeyManagementServiceClient - * Reference to {@link v1.KeyManagementServiceClient} - */ -module.exports = gapic.v1; - -/** - * @type {object} - * @property {constructor} KeyManagementServiceClient - * Reference to {@link v1.KeyManagementServiceClient} - */ -module.exports.v1 = gapic.v1; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-kms/src/index.ts similarity index 50% rename from packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_options.js rename to packages/google-cloud-kms/src/index.ts index 32288959104..020e1dc373d 100644 --- a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_options.js +++ b/packages/google-cloud-kms/src/index.ts @@ -11,6 +11,16 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. +import * as v1 from './v1'; +const KeyManagementServiceClient = v1.KeyManagementServiceClient; +export {v1, KeyManagementServiceClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1, KeyManagementServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_resources.js b/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_resources.js deleted file mode 100644 index b6175dfb57d..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_resources.js +++ /dev/null @@ -1,776 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A KeyRing is a toplevel logical grouping of CryptoKeys. - * - * @property {string} name - * Output only. The resource name for the KeyRing in the format - * `projects/* /locations/* /keyRings/*`. - * - * @property {Object} createTime - * Output only. The time at which this KeyRing was created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef KeyRing - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.KeyRing definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const KeyRing = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A CryptoKey represents a logical key that can be used for cryptographic - * operations. - * - * A CryptoKey is made up of one or more versions, which - * represent the actual key material used in cryptographic operations. - * - * @property {string} name - * Output only. The resource name for this CryptoKey in the format - * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * - * @property {Object} primary - * Output only. A copy of the "primary" CryptoKeyVersion that will be used - * by Encrypt when this CryptoKey is given - * in EncryptRequest.name. - * - * The CryptoKey's primary version can be updated via - * UpdateCryptoKeyPrimaryVersion. - * - * Keys with purpose - * ENCRYPT_DECRYPT may have a - * primary. For other keys, this field will be omitted. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * - * @property {number} purpose - * Immutable. The immutable purpose of this CryptoKey. - * - * The number should be among the values of [CryptoKeyPurpose]{@link google.cloud.kms.v1.CryptoKeyPurpose} - * - * @property {Object} createTime - * Output only. The time at which this CryptoKey was created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} nextRotationTime - * At next_rotation_time, the Key Management Service will automatically: - * - * 1. Create a new version of this CryptoKey. - * 2. Mark the new version as primary. - * - * Key rotations performed manually via - * CreateCryptoKeyVersion and - * UpdateCryptoKeyPrimaryVersion - * do not affect next_rotation_time. - * - * Keys with purpose - * ENCRYPT_DECRYPT support - * automatic rotation. For other keys, this field must be omitted. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} rotationPeriod - * next_rotation_time will be advanced by this period when the service - * automatically rotates a key. Must be at least 24 hours and at most - * 876,000 hours. - * - * If rotation_period is set, next_rotation_time must also be set. - * - * Keys with purpose - * ENCRYPT_DECRYPT support - * automatic rotation. For other keys, this field must be omitted. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} versionTemplate - * A template describing settings for new CryptoKeyVersion instances. - * The properties of new CryptoKeyVersion instances created by either - * CreateCryptoKeyVersion or - * auto-rotation are controlled by this template. - * - * This object should have the same structure as [CryptoKeyVersionTemplate]{@link google.cloud.kms.v1.CryptoKeyVersionTemplate} - * - * @property {Object.} labels - * Labels with user-defined metadata. For more information, see - * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - * - * @typedef CryptoKey - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CryptoKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const CryptoKey = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * CryptoKeyPurpose describes the cryptographic capabilities of a - * CryptoKey. A given key can only be used for the operations allowed by - * its purpose. For more information, see - * [Key purposes](https://cloud.google.com/kms/docs/algorithms#key_purposes). - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - CryptoKeyPurpose: { - - /** - * Not specified. - */ - CRYPTO_KEY_PURPOSE_UNSPECIFIED: 0, - - /** - * CryptoKeys with this purpose may be used with - * Encrypt and - * Decrypt. - */ - ENCRYPT_DECRYPT: 1, - - /** - * CryptoKeys with this purpose may be used with - * AsymmetricSign and - * GetPublicKey. - */ - ASYMMETRIC_SIGN: 5, - - /** - * CryptoKeys with this purpose may be used with - * AsymmetricDecrypt and - * GetPublicKey. - */ - ASYMMETRIC_DECRYPT: 6 - } -}; - -/** - * A CryptoKeyVersionTemplate specifies the properties to use when creating - * a new CryptoKeyVersion, either manually with - * CreateCryptoKeyVersion or - * automatically as a result of auto-rotation. - * - * @property {number} protectionLevel - * ProtectionLevel to use when creating a CryptoKeyVersion based on - * this template. Immutable. Defaults to SOFTWARE. - * - * The number should be among the values of [ProtectionLevel]{@link google.cloud.kms.v1.ProtectionLevel} - * - * @property {number} algorithm - * Required. Algorithm to use - * when creating a CryptoKeyVersion based on this template. - * - * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - * this field is omitted and CryptoKey.purpose is - * ENCRYPT_DECRYPT. - * - * The number should be among the values of [CryptoKeyVersionAlgorithm]{@link google.cloud.kms.v1.CryptoKeyVersionAlgorithm} - * - * @typedef CryptoKeyVersionTemplate - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CryptoKeyVersionTemplate definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const CryptoKeyVersionTemplate = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Contains an HSM-generated attestation about a key operation. For more - * information, see [Verifying attestations] - * (https://cloud.google.com/kms/docs/attest-key). - * - * @property {number} format - * Output only. The format of the attestation data. - * - * The number should be among the values of [AttestationFormat]{@link google.cloud.kms.v1.AttestationFormat} - * - * @property {Buffer} content - * Output only. The attestation data provided by the HSM when the key - * operation was performed. - * - * @typedef KeyOperationAttestation - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.KeyOperationAttestation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const KeyOperationAttestation = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Attestation formats provided by the HSM. - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - AttestationFormat: { - - /** - * Not specified. - */ - ATTESTATION_FORMAT_UNSPECIFIED: 0, - - /** - * Cavium HSM attestation compressed with gzip. Note that this format is - * defined by Cavium and subject to change at any time. - */ - CAVIUM_V1_COMPRESSED: 3, - - /** - * Cavium HSM attestation V2 compressed with gzip. This is a new format - * introduced in Cavium's version 3.2-08. - */ - CAVIUM_V2_COMPRESSED: 4 - } -}; - -/** - * A CryptoKeyVersion represents an individual cryptographic key, and the - * associated key material. - * - * An ENABLED version can be - * used for cryptographic operations. - * - * For security reasons, the raw cryptographic key material represented by a - * CryptoKeyVersion can never be viewed or exported. It can only be used to - * encrypt, decrypt, or sign data when an authorized user or application invokes - * Cloud KMS. - * - * @property {string} name - * Output only. The resource name for this CryptoKeyVersion in the format - * `projects/* /locations/* /keyRings/* /cryptoKeys/* /cryptoKeyVersions/*`. - * - * @property {number} state - * The current state of the CryptoKeyVersion. - * - * The number should be among the values of [CryptoKeyVersionState]{@link google.cloud.kms.v1.CryptoKeyVersionState} - * - * @property {number} protectionLevel - * Output only. The ProtectionLevel describing how crypto operations are - * performed with this CryptoKeyVersion. - * - * The number should be among the values of [ProtectionLevel]{@link google.cloud.kms.v1.ProtectionLevel} - * - * @property {number} algorithm - * Output only. The CryptoKeyVersionAlgorithm that this - * CryptoKeyVersion supports. - * - * The number should be among the values of [CryptoKeyVersionAlgorithm]{@link google.cloud.kms.v1.CryptoKeyVersionAlgorithm} - * - * @property {Object} attestation - * Output only. Statement that was generated and signed by the HSM at key - * creation time. Use this statement to verify attributes of the key as stored - * on the HSM, independently of Google. Only provided for key versions with - * protection_level HSM. - * - * This object should have the same structure as [KeyOperationAttestation]{@link google.cloud.kms.v1.KeyOperationAttestation} - * - * @property {Object} createTime - * Output only. The time at which this CryptoKeyVersion was created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} generateTime - * Output only. The time this CryptoKeyVersion's key material was - * generated. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} destroyTime - * Output only. The time this CryptoKeyVersion's key material is scheduled - * for destruction. Only present if state is - * DESTROY_SCHEDULED. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} destroyEventTime - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if state is - * DESTROYED. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} importJob - * Output only. The name of the ImportJob used to import this - * CryptoKeyVersion. Only present if the underlying key material was - * imported. - * - * @property {Object} importTime - * Output only. The time at which this CryptoKeyVersion's key material - * was imported. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} importFailureReason - * Output only. The root cause of an import failure. Only present if - * state is - * IMPORT_FAILED. - * - * @typedef CryptoKeyVersion - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CryptoKeyVersion definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const CryptoKeyVersion = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The algorithm of the CryptoKeyVersion, indicating what - * parameters must be used for each cryptographic operation. - * - * The - * GOOGLE_SYMMETRIC_ENCRYPTION - * algorithm is usable with CryptoKey.purpose - * ENCRYPT_DECRYPT. - * - * Algorithms beginning with "RSA_SIGN_" are usable with CryptoKey.purpose - * ASYMMETRIC_SIGN. - * - * The fields in the name after "RSA_SIGN_" correspond to the following - * parameters: padding algorithm, modulus bit length, and digest algorithm. - * - * For PSS, the salt length used is equal to the length of digest - * algorithm. For example, - * RSA_SIGN_PSS_2048_SHA256 - * will use PSS with a salt length of 256 bits or 32 bytes. - * - * Algorithms beginning with "RSA_DECRYPT_" are usable with - * CryptoKey.purpose - * ASYMMETRIC_DECRYPT. - * - * The fields in the name after "RSA_DECRYPT_" correspond to the following - * parameters: padding algorithm, modulus bit length, and digest algorithm. - * - * Algorithms beginning with "EC_SIGN_" are usable with CryptoKey.purpose - * ASYMMETRIC_SIGN. - * - * The fields in the name after "EC_SIGN_" correspond to the following - * parameters: elliptic curve, digest algorithm. - * - * For more information, see [Key purposes and algorithms] - * (https://cloud.google.com/kms/docs/algorithms). - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - CryptoKeyVersionAlgorithm: { - - /** - * Not specified. - */ - CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED: 0, - - /** - * Creates symmetric encryption keys. - */ - GOOGLE_SYMMETRIC_ENCRYPTION: 1, - - /** - * RSASSA-PSS 2048 bit key with a SHA256 digest. - */ - RSA_SIGN_PSS_2048_SHA256: 2, - - /** - * RSASSA-PSS 3072 bit key with a SHA256 digest. - */ - RSA_SIGN_PSS_3072_SHA256: 3, - - /** - * RSASSA-PSS 4096 bit key with a SHA256 digest. - */ - RSA_SIGN_PSS_4096_SHA256: 4, - - /** - * RSASSA-PSS 4096 bit key with a SHA512 digest. - */ - RSA_SIGN_PSS_4096_SHA512: 15, - - /** - * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. - */ - RSA_SIGN_PKCS1_2048_SHA256: 5, - - /** - * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. - */ - RSA_SIGN_PKCS1_3072_SHA256: 6, - - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. - */ - RSA_SIGN_PKCS1_4096_SHA256: 7, - - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. - */ - RSA_SIGN_PKCS1_4096_SHA512: 16, - - /** - * RSAES-OAEP 2048 bit key with a SHA256 digest. - */ - RSA_DECRYPT_OAEP_2048_SHA256: 8, - - /** - * RSAES-OAEP 3072 bit key with a SHA256 digest. - */ - RSA_DECRYPT_OAEP_3072_SHA256: 9, - - /** - * RSAES-OAEP 4096 bit key with a SHA256 digest. - */ - RSA_DECRYPT_OAEP_4096_SHA256: 10, - - /** - * RSAES-OAEP 4096 bit key with a SHA512 digest. - */ - RSA_DECRYPT_OAEP_4096_SHA512: 17, - - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - */ - EC_SIGN_P256_SHA256: 12, - - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - */ - EC_SIGN_P384_SHA384: 13 - }, - - /** - * The state of a CryptoKeyVersion, indicating if it can be used. - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - CryptoKeyVersionState: { - - /** - * Not specified. - */ - CRYPTO_KEY_VERSION_STATE_UNSPECIFIED: 0, - - /** - * This version is still being generated. It may not be used, enabled, - * disabled, or destroyed yet. Cloud KMS will automatically mark this - * version ENABLED as soon as the version is ready. - */ - PENDING_GENERATION: 5, - - /** - * This version may be used for cryptographic operations. - */ - ENABLED: 1, - - /** - * This version may not be used, but the key material is still available, - * and the version can be placed back into the ENABLED state. - */ - DISABLED: 2, - - /** - * This version is destroyed, and the key material is no longer stored. - * A version may not leave this state once entered. - */ - DESTROYED: 3, - - /** - * This version is scheduled for destruction, and will be destroyed soon. - * Call - * RestoreCryptoKeyVersion - * to put it back into the DISABLED state. - */ - DESTROY_SCHEDULED: 4, - - /** - * This version is still being imported. It may not be used, enabled, - * disabled, or destroyed yet. Cloud KMS will automatically mark this - * version ENABLED as soon as the version is ready. - */ - PENDING_IMPORT: 6, - - /** - * This version was not imported successfully. It may not be used, enabled, - * disabled, or destroyed. The submitted key material has been discarded. - * Additional details can be found in - * CryptoKeyVersion.import_failure_reason. - */ - IMPORT_FAILED: 7 - }, - - /** - * A view for CryptoKeyVersions. Controls the level of detail returned - * for CryptoKeyVersions in - * KeyManagementService.ListCryptoKeyVersions and - * KeyManagementService.ListCryptoKeys. - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - CryptoKeyVersionView: { - - /** - * Default view for each CryptoKeyVersion. Does not include - * the attestation field. - */ - CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED: 0, - - /** - * Provides all fields in each CryptoKeyVersion, including the - * attestation. - */ - FULL: 1 - } -}; - -/** - * The public key for a given CryptoKeyVersion. Obtained via - * GetPublicKey. - * - * @property {string} pem - * The public key, encoded in PEM format. For more information, see the - * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * @property {number} algorithm - * The Algorithm associated - * with this key. - * - * The number should be among the values of [CryptoKeyVersionAlgorithm]{@link google.cloud.kms.v1.CryptoKeyVersionAlgorithm} - * - * @typedef PublicKey - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.PublicKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const PublicKey = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An ImportJob can be used to create CryptoKeys and - * CryptoKeyVersions using pre-existing key material, - * generated outside of Cloud KMS. - * - * When an ImportJob is created, Cloud KMS will generate a "wrapping key", - * which is a public/private key pair. You use the wrapping key to encrypt (also - * known as wrap) the pre-existing key material to protect it during the import - * process. The nature of the wrapping key depends on the choice of - * import_method. When the wrapping key generation - * is complete, the state will be set to - * ACTIVE and the public_key - * can be fetched. The fetched public key can then be used to wrap your - * pre-existing key material. - * - * Once the key material is wrapped, it can be imported into a new - * CryptoKeyVersion in an existing CryptoKey by calling - * ImportCryptoKeyVersion. - * Multiple CryptoKeyVersions can be imported with a single - * ImportJob. Cloud KMS uses the private key portion of the wrapping key to - * unwrap the key material. Only Cloud KMS has access to the private key. - * - * An ImportJob expires 3 days after it is created. Once expired, Cloud KMS - * will no longer be able to import or unwrap any key material that was wrapped - * with the ImportJob's public key. - * - * For more information, see - * [Importing a key](https://cloud.google.com/kms/docs/importing-a-key). - * - * @property {string} name - * Output only. The resource name for this ImportJob in the format - * `projects/* /locations/* /keyRings/* /importJobs/*`. - * - * @property {number} importMethod - * Required. Immutable. The wrapping method to be used for incoming key material. - * - * The number should be among the values of [ImportMethod]{@link google.cloud.kms.v1.ImportMethod} - * - * @property {number} protectionLevel - * Required. Immutable. The protection level of the ImportJob. This must match the - * protection_level of the - * version_template on the CryptoKey you - * attempt to import into. - * - * The number should be among the values of [ProtectionLevel]{@link google.cloud.kms.v1.ProtectionLevel} - * - * @property {Object} createTime - * Output only. The time at which this ImportJob was created. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} generateTime - * Output only. The time this ImportJob's key material was generated. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} expireTime - * Output only. The time at which this ImportJob is scheduled for - * expiration and can no longer be used to import key material. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} expireEventTime - * Output only. The time this ImportJob expired. Only present if - * state is EXPIRED. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {number} state - * Output only. The current state of the ImportJob, indicating if it can - * be used. - * - * The number should be among the values of [ImportJobState]{@link google.cloud.kms.v1.ImportJobState} - * - * @property {Object} publicKey - * Output only. The public key with which to wrap key material prior to - * import. Only returned if state is - * ACTIVE. - * - * This object should have the same structure as [WrappingPublicKey]{@link google.cloud.kms.v1.WrappingPublicKey} - * - * @property {Object} attestation - * Output only. Statement that was generated and signed by the key creator - * (for example, an HSM) at key creation time. Use this statement to verify - * attributes of the key as stored on the HSM, independently of Google. - * Only present if the chosen ImportMethod is one with a protection - * level of HSM. - * - * This object should have the same structure as [KeyOperationAttestation]{@link google.cloud.kms.v1.KeyOperationAttestation} - * - * @typedef ImportJob - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ImportJob definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ -const ImportJob = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The public key component of the wrapping key. For details of the type of - * key this public key corresponds to, see the ImportMethod. - * - * @property {string} pem - * The public key, encoded in PEM format. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * @typedef WrappingPublicKey - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ImportJob.WrappingPublicKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/resources.proto} - */ - WrappingPublicKey: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * The state of the ImportJob, indicating if it can be used. - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - ImportJobState: { - - /** - * Not specified. - */ - IMPORT_JOB_STATE_UNSPECIFIED: 0, - - /** - * The wrapping key for this job is still being generated. It may not be - * used. Cloud KMS will automatically mark this job as - * ACTIVE as soon as the wrapping key is generated. - */ - PENDING_GENERATION: 1, - - /** - * This job may be used in - * CreateCryptoKey and - * CreateCryptoKeyVersion - * requests. - */ - ACTIVE: 2, - - /** - * This job can no longer be used and may not leave this state once entered. - */ - EXPIRED: 3 - }, - - /** - * ImportMethod describes the key wrapping method chosen for this - * ImportJob. - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ - ImportMethod: { - - /** - * Not specified. - */ - IMPORT_METHOD_UNSPECIFIED: 0, - - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 3072 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - */ - RSA_OAEP_3072_SHA1_AES_256: 1, - - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 4096 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - */ - RSA_OAEP_4096_SHA1_AES_256: 2 - } -}; - -/** - * ProtectionLevel specifies how cryptographic operations are performed. - * For more information, see [Protection levels] - * (https://cloud.google.com/kms/docs/algorithms#protection_levels). - * - * @enum {number} - * @memberof google.cloud.kms.v1 - */ -const ProtectionLevel = { - - /** - * Not specified. - */ - PROTECTION_LEVEL_UNSPECIFIED: 0, - - /** - * Crypto operations are performed in software. - */ - SOFTWARE: 1, - - /** - * Crypto operations are performed in a Hardware Security Module. - */ - HSM: 2, - - /** - * Crypto operations are performed by an external key manager. - */ - EXTERNAL: 3 -}; \ No newline at end of file diff --git a/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_service.js b/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_service.js deleted file mode 100644 index 1a61d2f6d45..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/cloud/kms/v1/doc_service.js +++ /dev/null @@ -1,776 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for KeyManagementService.ListKeyRings. - * - * @property {string} parent - * Required. The resource name of the location associated with the - * KeyRings, in the format `projects/* /locations/*`. - * - * @property {number} pageSize - * Optional. Optional limit on the number of KeyRings to include in the - * response. Further KeyRings can subsequently be obtained by - * including the ListKeyRingsResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * - * @property {string} pageToken - * Optional. Optional pagination token, returned earlier via - * ListKeyRingsResponse.next_page_token. - * - * @property {string} filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @property {string} orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @typedef ListKeyRingsRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListKeyRingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListKeyRingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.ListCryptoKeys. - * - * @property {string} parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * - * @property {number} pageSize - * Optional. Optional limit on the number of CryptoKeys to include in the - * response. Further CryptoKeys can subsequently be obtained by - * including the ListCryptoKeysResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * - * @property {string} pageToken - * Optional. Optional pagination token, returned earlier via - * ListCryptoKeysResponse.next_page_token. - * - * @property {number} versionView - * The fields of the primary version to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * - * @property {string} filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @property {string} orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @typedef ListCryptoKeysRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListCryptoKeysRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListCryptoKeysRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.ListCryptoKeyVersions. - * - * @property {string} parent - * Required. The resource name of the CryptoKey to list, in the format - * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * - * @property {number} pageSize - * Optional. Optional limit on the number of CryptoKeyVersions to - * include in the response. Further CryptoKeyVersions can - * subsequently be obtained by including the - * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. - * If unspecified, the server will pick an appropriate default. - * - * @property {string} pageToken - * Optional. Optional pagination token, returned earlier via - * ListCryptoKeyVersionsResponse.next_page_token. - * - * @property {number} view - * The fields to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * - * @property {string} filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @property {string} orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @typedef ListCryptoKeyVersionsRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListCryptoKeyVersionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListCryptoKeyVersionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.ListImportJobs. - * - * @property {string} parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * - * @property {number} pageSize - * Optional. Optional limit on the number of ImportJobs to include in the - * response. Further ImportJobs can subsequently be obtained by - * including the ListImportJobsResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * - * @property {string} pageToken - * Optional. Optional pagination token, returned earlier via - * ListImportJobsResponse.next_page_token. - * - * @property {string} filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @property {string} orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * @typedef ListImportJobsRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListImportJobsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListImportJobsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.ListKeyRings. - * - * @property {Object[]} keyRings - * The list of KeyRings. - * - * This object should have the same structure as [KeyRing]{@link google.cloud.kms.v1.KeyRing} - * - * @property {string} nextPageToken - * A token to retrieve next page of results. Pass this value in - * ListKeyRingsRequest.page_token to retrieve the next page of results. - * - * @property {number} totalSize - * The total number of KeyRings that matched the query. - * - * @typedef ListKeyRingsResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListKeyRingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListKeyRingsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.ListCryptoKeys. - * - * @property {Object[]} cryptoKeys - * The list of CryptoKeys. - * - * This object should have the same structure as [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} - * - * @property {string} nextPageToken - * A token to retrieve next page of results. Pass this value in - * ListCryptoKeysRequest.page_token to retrieve the next page of results. - * - * @property {number} totalSize - * The total number of CryptoKeys that matched the query. - * - * @typedef ListCryptoKeysResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListCryptoKeysResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListCryptoKeysResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.ListCryptoKeyVersions. - * - * @property {Object[]} cryptoKeyVersions - * The list of CryptoKeyVersions. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * - * @property {string} nextPageToken - * A token to retrieve next page of results. Pass this value in - * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of - * results. - * - * @property {number} totalSize - * The total number of CryptoKeyVersions that matched the - * query. - * - * @typedef ListCryptoKeyVersionsResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListCryptoKeyVersionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListCryptoKeyVersionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.ListImportJobs. - * - * @property {Object[]} importJobs - * The list of ImportJobs. - * - * This object should have the same structure as [ImportJob]{@link google.cloud.kms.v1.ImportJob} - * - * @property {string} nextPageToken - * A token to retrieve next page of results. Pass this value in - * ListImportJobsRequest.page_token to retrieve the next page of results. - * - * @property {number} totalSize - * The total number of ImportJobs that matched the query. - * - * @typedef ListImportJobsResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ListImportJobsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ListImportJobsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.GetKeyRing. - * - * @property {string} name - * Required. The name of the KeyRing to get. - * - * @typedef GetKeyRingRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.GetKeyRingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const GetKeyRingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.GetCryptoKey. - * - * @property {string} name - * Required. The name of the CryptoKey to get. - * - * @typedef GetCryptoKeyRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.GetCryptoKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const GetCryptoKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.GetCryptoKeyVersion. - * - * @property {string} name - * Required. The name of the CryptoKeyVersion to get. - * - * @typedef GetCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.GetCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const GetCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.GetPublicKey. - * - * @property {string} name - * Required. The name of the CryptoKeyVersion public key to - * get. - * - * @typedef GetPublicKeyRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.GetPublicKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const GetPublicKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.GetImportJob. - * - * @property {string} name - * Required. The name of the ImportJob to get. - * - * @typedef GetImportJobRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.GetImportJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const GetImportJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.CreateKeyRing. - * - * @property {string} parent - * Required. The resource name of the location associated with the - * KeyRings, in the format `projects/* /locations/*`. - * - * @property {string} keyRingId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * @property {Object} keyRing - * Required. A KeyRing with initial field values. - * - * This object should have the same structure as [KeyRing]{@link google.cloud.kms.v1.KeyRing} - * - * @typedef CreateKeyRingRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CreateKeyRingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const CreateKeyRingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.CreateCryptoKey. - * - * @property {string} parent - * Required. The name of the KeyRing associated with the - * CryptoKeys. - * - * @property {string} cryptoKeyId - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * @property {Object} cryptoKey - * Required. A CryptoKey with initial field values. - * - * This object should have the same structure as [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} - * - * @property {boolean} skipInitialVersionCreation - * If set to true, the request will create a CryptoKey without any - * CryptoKeyVersions. You must manually call - * CreateCryptoKeyVersion or - * ImportCryptoKeyVersion - * before you can use this CryptoKey. - * - * @typedef CreateCryptoKeyRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CreateCryptoKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const CreateCryptoKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.CreateCryptoKeyVersion. - * - * @property {string} parent - * Required. The name of the CryptoKey associated with - * the CryptoKeyVersions. - * - * @property {Object} cryptoKeyVersion - * Required. A CryptoKeyVersion with initial field values. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * - * @typedef CreateCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CreateCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const CreateCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.ImportCryptoKeyVersion. - * - * @property {string} parent - * Required. The name of the CryptoKey to - * be imported into. - * - * @property {number} algorithm - * Required. The algorithm of - * the key being imported. This does not need to match the - * version_template of the CryptoKey this - * version imports into. - * - * The number should be among the values of [CryptoKeyVersionAlgorithm]{@link google.cloud.kms.v1.CryptoKeyVersionAlgorithm} - * - * @property {string} importJob - * Required. The name of the ImportJob that was used to - * wrap this key material. - * - * @property {Buffer} rsaAesWrappedKey - * Wrapped key material produced with - * RSA_OAEP_3072_SHA1_AES_256 - * or - * RSA_OAEP_4096_SHA1_AES_256. - * - * This field contains the concatenation of two wrapped keys: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * public_key using RSAES-OAEP with SHA-1, - * MGF1 with SHA-1, and an empty label. - *
  2. - *
  3. The key to be imported, wrapped with the ephemeral AES-256 key - * using AES-KWP (RFC 5649). - *
  4. - *
- * - * If importing symmetric key material, it is expected that the unwrapped - * key contains plain bytes. If importing asymmetric key material, it is - * expected that the unwrapped key is in PKCS#8-encoded DER format (the - * PrivateKeyInfo structure from RFC 5208). - * - * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * - * @typedef ImportCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.ImportCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const ImportCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.CreateImportJob. - * - * @property {string} parent - * Required. The name of the KeyRing associated with the - * ImportJobs. - * - * @property {string} importJobId - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * @property {Object} importJob - * Required. An ImportJob with initial field values. - * - * This object should have the same structure as [ImportJob]{@link google.cloud.kms.v1.ImportJob} - * - * @typedef CreateImportJobRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.CreateImportJobRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const CreateImportJobRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.UpdateCryptoKey. - * - * @property {Object} cryptoKey - * Required. CryptoKey with updated values. - * - * This object should have the same structure as [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} - * - * @property {Object} updateMask - * Required. List of fields to be updated in this request. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateCryptoKeyRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.UpdateCryptoKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const UpdateCryptoKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.UpdateCryptoKeyVersion. - * - * @property {Object} cryptoKeyVersion - * Required. CryptoKeyVersion with updated values. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * - * @property {Object} updateMask - * Required. List of fields to be updated in this request. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.UpdateCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const UpdateCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.Encrypt. - * - * @property {string} name - * Required. The resource name of the CryptoKey or CryptoKeyVersion - * to use for encryption. - * - * If a CryptoKey is specified, the server will use its - * primary version. - * - * @property {Buffer} plaintext - * Required. The data to encrypt. Must be no larger than 64KiB. - * - * The maximum size depends on the key version's - * protection_level. For - * SOFTWARE keys, the plaintext must be no larger - * than 64KiB. For HSM keys, the combined length of the - * plaintext and additional_authenticated_data fields must be no larger than - * 8KiB. - * - * @property {Buffer} additionalAuthenticatedData - * Optional. Optional data that, if specified, must also be provided during decryption - * through DecryptRequest.additional_authenticated_data. - * - * The maximum size depends on the key version's - * protection_level. For - * SOFTWARE keys, the AAD must be no larger than - * 64KiB. For HSM keys, the combined length of the - * plaintext and additional_authenticated_data fields must be no larger than - * 8KiB. - * - * @typedef EncryptRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.EncryptRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const EncryptRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.Decrypt. - * - * @property {string} name - * Required. The resource name of the CryptoKey to use for decryption. - * The server will choose the appropriate version. - * - * @property {Buffer} ciphertext - * Required. The encrypted data originally returned in - * EncryptResponse.ciphertext. - * - * @property {Buffer} additionalAuthenticatedData - * Optional. Optional data that must match the data originally supplied in - * EncryptRequest.additional_authenticated_data. - * - * @typedef DecryptRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.DecryptRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const DecryptRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.AsymmetricSign. - * - * @property {string} name - * Required. The resource name of the CryptoKeyVersion to use for signing. - * - * @property {Object} digest - * Required. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * algorithm. - * - * This object should have the same structure as [Digest]{@link google.cloud.kms.v1.Digest} - * - * @typedef AsymmetricSignRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.AsymmetricSignRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const AsymmetricSignRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.AsymmetricDecrypt. - * - * @property {string} name - * Required. The resource name of the CryptoKeyVersion to use for - * decryption. - * - * @property {Buffer} ciphertext - * Required. The data encrypted with the named CryptoKeyVersion's public - * key using OAEP. - * - * @typedef AsymmetricDecryptRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.AsymmetricDecryptRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const AsymmetricDecryptRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.Decrypt. - * - * @property {Buffer} plaintext - * The decrypted data originally supplied in EncryptRequest.plaintext. - * - * @typedef DecryptResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.DecryptResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const DecryptResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.Encrypt. - * - * @property {string} name - * The resource name of the CryptoKeyVersion used in encryption. Check - * this field to verify that the intended resource was used for encryption. - * - * @property {Buffer} ciphertext - * The encrypted data. - * - * @typedef EncryptResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.EncryptResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const EncryptResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.AsymmetricSign. - * - * @property {Buffer} signature - * The created signature. - * - * @typedef AsymmetricSignResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.AsymmetricSignResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const AsymmetricSignResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for KeyManagementService.AsymmetricDecrypt. - * - * @property {Buffer} plaintext - * The decrypted data originally encrypted with the matching public key. - * - * @typedef AsymmetricDecryptResponse - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.AsymmetricDecryptResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const AsymmetricDecryptResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. - * - * @property {string} name - * Required. The resource name of the CryptoKey to update. - * - * @property {string} cryptoKeyVersionId - * Required. The id of the child CryptoKeyVersion to use as primary. - * - * @typedef UpdateCryptoKeyPrimaryVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const UpdateCryptoKeyPrimaryVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.DestroyCryptoKeyVersion. - * - * @property {string} name - * Required. The resource name of the CryptoKeyVersion to destroy. - * - * @typedef DestroyCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.DestroyCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const DestroyCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for KeyManagementService.RestoreCryptoKeyVersion. - * - * @property {string} name - * Required. The resource name of the CryptoKeyVersion to restore. - * - * @typedef RestoreCryptoKeyVersionRequest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.RestoreCryptoKeyVersionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const RestoreCryptoKeyVersionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Digest holds a cryptographic message digest. - * - * @property {Buffer} sha256 - * A message digest produced with the SHA-256 algorithm. - * - * @property {Buffer} sha384 - * A message digest produced with the SHA-384 algorithm. - * - * @property {Buffer} sha512 - * A message digest produced with the SHA-512 algorithm. - * - * @typedef Digest - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.Digest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const Digest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud KMS metadata for the given google.cloud.location.Location. - * - * @property {boolean} hsmAvailable - * Indicates whether CryptoKeys with - * protection_level - * HSM can be created in this location. - * - * @typedef LocationMetadata - * @memberof google.cloud.kms.v1 - * @see [google.cloud.kms.v1.LocationMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/kms/v1/service.proto} - */ -const LocationMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index 32288959104..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. diff --git a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee6067..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index c86af4e3d22..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-kms/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-kms/src/v1/doc/google/type/doc_expr.js deleted file mode 100644 index 32288959104..00000000000 --- a/packages/google-cloud-kms/src/v1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. diff --git a/packages/google-cloud-kms/src/browser.js b/packages/google-cloud-kms/src/v1/index.ts similarity index 64% rename from packages/google-cloud-kms/src/browser.js rename to packages/google-cloud-kms/src/v1/index.ts index 68dc62d25d6..b5abfc61f00 100644 --- a/packages/google-cloud-kms/src/browser.js +++ b/packages/google-cloud-kms/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,11 +11,9 @@ // 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'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {KeyManagementServiceClient} from './key_management_service_client'; diff --git a/packages/google-cloud-kms/src/v1/key_management_service_client.js b/packages/google-cloud-kms/src/v1/key_management_service_client.js deleted file mode 100644 index a3a493b0f03..00000000000 --- a/packages/google-cloud-kms/src/v1/key_management_service_client.js +++ /dev/null @@ -1,2963 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./key_management_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Google Cloud Key Management Service - * - * Manages cryptographic keys and operations using those keys. Implements a REST - * model with the following objects: - * - * * KeyRing - * * CryptoKey - * * CryptoKeyVersion - * * ImportJob - * - * If you are using manual gRPC libraries, see - * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - * - * @class - * @memberof v1 - */ -class KeyManagementServiceClient { - /** - * Construct an instance of KeyManagementServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - cryptoKeyPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - cryptoKeyPathPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}' - ), - cryptoKeyVersionPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' - ), - importJobPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}' - ), - keyRingPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}' - ), - locationPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - }; - - // 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 = { - listKeyRings: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'keyRings' - ), - listImportJobs: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'importJobs' - ), - listCryptoKeys: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'cryptoKeys' - ), - listCryptoKeyVersions: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'cryptoKeyVersions' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.kms.v1.KeyManagementService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.kms.v1.KeyManagementService. - const keyManagementServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.cloud.kms.v1.KeyManagementService') - : protos.google.cloud.kms.v1.KeyManagementService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const keyManagementServiceStubMethods = [ - 'listKeyRings', - 'listImportJobs', - 'listCryptoKeys', - 'listCryptoKeyVersions', - 'getKeyRing', - 'getImportJob', - 'getCryptoKey', - 'getCryptoKeyVersion', - 'createKeyRing', - 'createImportJob', - 'createCryptoKey', - 'createCryptoKeyVersion', - 'importCryptoKeyVersion', - 'updateCryptoKey', - 'updateCryptoKeyVersion', - 'encrypt', - 'decrypt', - 'updateCryptoKeyPrimaryVersion', - 'destroyCryptoKeyVersion', - 'restoreCryptoKeyVersion', - 'getPublicKey', - 'asymmetricDecrypt', - 'asymmetricSign', - ]; - for (const methodName of keyManagementServiceStubMethods) { - const innerCallPromise = keyManagementServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - - // Put together the "service stub" for - // google.iam.v1.IAMPolicy. - const iamPolicyStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.iam.v1.IAMPolicy') - : protos.google.iam.v1.IAMPolicy, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const iamPolicyStubMethods = [ - 'setIamPolicy', - 'getIamPolicy', - 'testIamPermissions', - ]; - for (const methodName of iamPolicyStubMethods) { - const innerCallPromise = iamPolicyStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'cloudkms.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'cloudkms.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloudkms', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists KeyRings. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * KeyRings, in the format `projects/* /locations/*`. - * @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 {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListKeyRingsResponse]{@link google.cloud.kms.v1.ListKeyRingsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [KeyRing]{@link google.cloud.kms.v1.KeyRing} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListKeyRingsResponse]{@link google.cloud.kms.v1.ListKeyRingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * - * client.listKeyRings({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listKeyRings(nextRequest, options).then(callback); - * } - * } - * client.listKeyRings({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listKeyRings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listKeyRings(request, options, callback); - } - - /** - * Equivalent to {@link listKeyRings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeyRings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * KeyRings, in the format `projects/* /locations/*`. - * @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 {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [KeyRing]{@link google.cloud.kms.v1.KeyRing} on 'data' event. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * client.listKeyRingsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listKeyRingsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listKeyRings.createStream( - this._innerApiCalls.listKeyRings, - request, - options - ); - } - - /** - * Lists ImportJobs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * @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 {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListImportJobsResponse]{@link google.cloud.kms.v1.ListImportJobsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ImportJob]{@link google.cloud.kms.v1.ImportJob} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListImportJobsResponse]{@link google.cloud.kms.v1.ListImportJobsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * - * client.listImportJobs({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listImportJobs(nextRequest, options).then(callback); - * } - * } - * client.listImportJobs({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listImportJobs(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listImportJobs(request, options, callback); - } - - /** - * Equivalent to {@link listImportJobs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listImportJobs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * @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 {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [ImportJob]{@link google.cloud.kms.v1.ImportJob} on 'data' event. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * client.listImportJobsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listImportJobsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listImportJobs.createStream( - this._innerApiCalls.listImportJobs, - request, - options - ); - } - - /** - * Lists CryptoKeys. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * @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 {number} [request.versionView] - * The fields of the primary version to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListCryptoKeysResponse]{@link google.cloud.kms.v1.ListCryptoKeysResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListCryptoKeysResponse]{@link google.cloud.kms.v1.ListCryptoKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * - * client.listCryptoKeys({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listCryptoKeys(nextRequest, options).then(callback); - * } - * } - * client.listCryptoKeys({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listCryptoKeys(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listCryptoKeys(request, options, callback); - } - - /** - * Equivalent to {@link listCryptoKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listCryptoKeys} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the KeyRing to list, in the format - * `projects/* /locations/* /keyRings/*`. - * @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 {number} [request.versionView] - * The fields of the primary version to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} on 'data' event. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * client.listCryptoKeysStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listCryptoKeysStream(request, options) { - options = options || {}; - - return this._descriptors.page.listCryptoKeys.createStream( - this._innerApiCalls.listCryptoKeys, - request, - options - ); - } - - /** - * Lists CryptoKeyVersions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the CryptoKey to list, in the format - * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * @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 {number} [request.view] - * The fields to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListCryptoKeyVersionsResponse]{@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListCryptoKeyVersionsResponse]{@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * - * client.listCryptoKeyVersions({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listCryptoKeyVersions(nextRequest, options).then(callback); - * } - * } - * client.listCryptoKeyVersions({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listCryptoKeyVersions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listCryptoKeyVersions( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listCryptoKeyVersions}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listCryptoKeyVersions} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the CryptoKey to list, in the format - * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * @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 {number} [request.view] - * The fields to include in the response. - * - * The number should be among the values of [CryptoKeyVersionView]{@link google.cloud.kms.v1.CryptoKeyVersionView} - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} on 'data' event. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * client.listCryptoKeyVersionsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listCryptoKeyVersionsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listCryptoKeyVersions.createStream( - this._innerApiCalls.listCryptoKeyVersions, - request, - options - ); - } - - /** - * Returns metadata for a given KeyRing. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the KeyRing to get. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * client.getKeyRing({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getKeyRing(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getKeyRing(request, options, callback); - } - - /** - * Returns metadata for a given ImportJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the ImportJob to get. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.importJobPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - * client.getImportJob({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getImportJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getImportJob(request, options, callback); - } - - /** - * Returns metadata for a given CryptoKey, as well as its - * primary CryptoKeyVersion. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CryptoKey to get. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * client.getCryptoKey({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getCryptoKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getCryptoKey(request, options, callback); - } - - /** - * Returns metadata for a given CryptoKeyVersion. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CryptoKeyVersion to get. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * client.getCryptoKeyVersion({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getCryptoKeyVersion(request, options, callback); - } - - /** - * Create a new KeyRing in a given Project and Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * KeyRings, in the format `projects/* /locations/*`. - * @param {string} request.keyRingId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {Object} request.keyRing - * Required. A KeyRing with initial field values. - * - * This object should have the same structure as [KeyRing]{@link google.cloud.kms.v1.KeyRing} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KeyRing]{@link google.cloud.kms.v1.KeyRing}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - * const keyRingId = ''; - * const keyRing = {}; - * const request = { - * parent: formattedParent, - * keyRingId: keyRingId, - * keyRing: keyRing, - * }; - * client.createKeyRing(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createKeyRing(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createKeyRing(request, options, callback); - } - - /** - * Create a new ImportJob within a KeyRing. - * - * ImportJob.import_method is required. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the KeyRing associated with the - * ImportJobs. - * @param {string} request.importJobId - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {Object} request.importJob - * Required. An ImportJob with initial field values. - * - * This object should have the same structure as [ImportJob]{@link google.cloud.kms.v1.ImportJob} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ImportJob]{@link google.cloud.kms.v1.ImportJob}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * const importJobId = 'my-import-job'; - * const importMethod = 'RSA_OAEP_3072_SHA1_AES_256'; - * const protectionLevel = 'HSM'; - * const importJob = { - * importMethod: importMethod, - * protectionLevel: protectionLevel, - * }; - * const request = { - * parent: formattedParent, - * importJobId: importJobId, - * importJob: importJob, - * }; - * client.createImportJob(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createImportJob(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createImportJob(request, options, callback); - } - - /** - * Create a new CryptoKey within a KeyRing. - * - * CryptoKey.purpose and - * CryptoKey.version_template.algorithm - * are required. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the KeyRing associated with the - * CryptoKeys. - * @param {string} request.cryptoKeyId - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {Object} request.cryptoKey - * Required. A CryptoKey with initial field values. - * - * This object should have the same structure as [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} - * @param {boolean} [request.skipInitialVersionCreation] - * If set to true, the request will create a CryptoKey without any - * CryptoKeyVersions. You must manually call - * CreateCryptoKeyVersion or - * ImportCryptoKeyVersion - * before you can use this CryptoKey. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * const cryptoKeyId = 'my-app-key'; - * const purpose = 'ENCRYPT_DECRYPT'; - * const seconds = 2147483647; - * const nextRotationTime = { - * seconds: seconds, - * }; - * const seconds2 = 604800; - * const rotationPeriod = { - * seconds: seconds2, - * }; - * const cryptoKey = { - * purpose: purpose, - * nextRotationTime: nextRotationTime, - * rotationPeriod: rotationPeriod, - * }; - * const request = { - * parent: formattedParent, - * cryptoKeyId: cryptoKeyId, - * cryptoKey: cryptoKey, - * }; - * client.createCryptoKey(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createCryptoKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createCryptoKey(request, options, callback); - } - - /** - * Create a new CryptoKeyVersion in a CryptoKey. - * - * The server will assign the next sequential id. If unset, - * state will be set to - * ENABLED. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the CryptoKey associated with - * the CryptoKeyVersions. - * @param {Object} request.cryptoKeyVersion - * Required. A CryptoKeyVersion with initial field values. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * const cryptoKeyVersion = {}; - * const request = { - * parent: formattedParent, - * cryptoKeyVersion: cryptoKeyVersion, - * }; - * client.createCryptoKeyVersion(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createCryptoKeyVersion( - request, - options, - callback - ); - } - - /** - * Imports a new CryptoKeyVersion into an existing CryptoKey using the - * wrapped key material provided in the request. - * - * The version ID will be assigned the next sequential id within the - * CryptoKey. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the CryptoKey to - * be imported into. - * @param {number} request.algorithm - * Required. The algorithm of - * the key being imported. This does not need to match the - * version_template of the CryptoKey this - * version imports into. - * - * The number should be among the values of [CryptoKeyVersionAlgorithm]{@link google.cloud.kms.v1.CryptoKeyVersionAlgorithm} - * @param {string} request.importJob - * Required. The name of the ImportJob that was used to - * wrap this key material. - * @param {Buffer} [request.rsaAesWrappedKey] - * Wrapped key material produced with - * RSA_OAEP_3072_SHA1_AES_256 - * or - * RSA_OAEP_4096_SHA1_AES_256. - * - * This field contains the concatenation of two wrapped keys: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * public_key using RSAES-OAEP with SHA-1, - * MGF1 with SHA-1, and an empty label. - *
  2. - *
  3. The key to be imported, wrapped with the ephemeral AES-256 key - * using AES-KWP (RFC 5649). - *
  4. - *
- * - * If importing symmetric key material, it is expected that the unwrapped - * key contains plain bytes. If importing asymmetric key material, it is - * expected that the unwrapped key is in PKCS#8-encoded DER format (the - * PrivateKeyInfo structure from RFC 5208). - * - * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * const algorithm = 'CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED'; - * const importJob = ''; - * const request = { - * parent: formattedParent, - * algorithm: algorithm, - * importJob: importJob, - * }; - * client.importCryptoKeyVersion(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - importCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.importCryptoKeyVersion( - request, - options, - callback - ); - } - - /** - * Update a CryptoKey. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.cryptoKey - * Required. CryptoKey with updated values. - * - * This object should have the same structure as [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} - * @param {Object} request.updateMask - * Required. List of fields to be updated in this request. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const cryptoKey = {}; - * const updateMask = {}; - * const request = { - * cryptoKey: cryptoKey, - * updateMask: updateMask, - * }; - * client.updateCryptoKey(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateCryptoKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'crypto_key.name': request.cryptoKey.name, - }); - - return this._innerApiCalls.updateCryptoKey(request, options, callback); - } - - /** - * Update a CryptoKeyVersion's metadata. - * - * state may be changed between - * ENABLED and - * DISABLED using this - * method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to - * move between other states. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.cryptoKeyVersion - * Required. CryptoKeyVersion with updated values. - * - * This object should have the same structure as [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} - * @param {Object} request.updateMask - * Required. List of fields to be updated in this request. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const cryptoKeyVersion = {}; - * const updateMask = {}; - * const request = { - * cryptoKeyVersion: cryptoKeyVersion, - * updateMask: updateMask, - * }; - * client.updateCryptoKeyVersion(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'crypto_key_version.name': request.cryptoKeyVersion.name, - }); - - return this._innerApiCalls.updateCryptoKeyVersion( - request, - options, - callback - ); - } - - /** - * Encrypts data, so that it can only be recovered by a call to Decrypt. - * The CryptoKey.purpose must be - * ENCRYPT_DECRYPT. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKey or CryptoKeyVersion - * to use for encryption. - * - * If a CryptoKey is specified, the server will use its - * primary version. - * @param {Buffer} request.plaintext - * Required. The data to encrypt. Must be no larger than 64KiB. - * - * The maximum size depends on the key version's - * protection_level. For - * SOFTWARE keys, the plaintext must be no larger - * than 64KiB. For HSM keys, the combined length of the - * plaintext and additional_authenticated_data fields must be no larger than - * 8KiB. - * @param {Buffer} [request.additionalAuthenticatedData] - * Optional. Optional data that, if specified, must also be provided during decryption - * through DecryptRequest.additional_authenticated_data. - * - * The maximum size depends on the key version's - * protection_level. For - * SOFTWARE keys, the AAD must be no larger than - * 64KiB. For HSM keys, the combined length of the - * plaintext and additional_authenticated_data fields must be no larger than - * 8KiB. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [EncryptResponse]{@link google.cloud.kms.v1.EncryptResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EncryptResponse]{@link google.cloud.kms.v1.EncryptResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyPathPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY_PATH]'); - * const plaintext = Buffer.from(''); - * const request = { - * name: formattedName, - * plaintext: plaintext, - * }; - * client.encrypt(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - encrypt(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.encrypt(request, options, callback); - } - - /** - * Decrypts data that was protected by Encrypt. The CryptoKey.purpose - * must be ENCRYPT_DECRYPT. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKey to use for decryption. - * The server will choose the appropriate version. - * @param {Buffer} request.ciphertext - * Required. The encrypted data originally returned in - * EncryptResponse.ciphertext. - * @param {Buffer} [request.additionalAuthenticatedData] - * Optional. Optional data that must match the data originally supplied in - * EncryptRequest.additional_authenticated_data. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [DecryptResponse]{@link google.cloud.kms.v1.DecryptResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DecryptResponse]{@link google.cloud.kms.v1.DecryptResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * const ciphertext = Buffer.from(''); - * const request = { - * name: formattedName, - * ciphertext: ciphertext, - * }; - * client.decrypt(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - decrypt(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.decrypt(request, options, callback); - } - - /** - * Update the version of a CryptoKey that will be used in Encrypt. - * - * Returns an error if called on an asymmetric key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKey to update. - * @param {string} request.cryptoKeyVersionId - * Required. The id of the child CryptoKeyVersion to use as primary. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * const cryptoKeyVersionId = ''; - * const request = { - * name: formattedName, - * cryptoKeyVersionId: cryptoKeyVersionId, - * }; - * client.updateCryptoKeyPrimaryVersion(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateCryptoKeyPrimaryVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.updateCryptoKeyPrimaryVersion( - request, - options, - callback - ); - } - - /** - * Schedule a CryptoKeyVersion for destruction. - * - * Upon calling this method, CryptoKeyVersion.state will be set to - * DESTROY_SCHEDULED - * and destroy_time will be set to a time 24 - * hours in the future, at which point the state - * will be changed to - * DESTROYED, and the key - * material will be irrevocably destroyed. - * - * Before the destroy_time is reached, - * RestoreCryptoKeyVersion may be called to reverse the process. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKeyVersion to destroy. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * client.destroyCryptoKeyVersion({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - destroyCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.destroyCryptoKeyVersion( - request, - options, - callback - ); - } - - /** - * Restore a CryptoKeyVersion in the - * DESTROY_SCHEDULED - * state. - * - * Upon restoration of the CryptoKeyVersion, state - * will be set to DISABLED, - * and destroy_time will be cleared. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKeyVersion to restore. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * client.restoreCryptoKeyVersion({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - restoreCryptoKeyVersion(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.restoreCryptoKeyVersion( - request, - options, - callback - ); - } - - /** - * Returns the public key for the given CryptoKeyVersion. The - * CryptoKey.purpose must be - * ASYMMETRIC_SIGN or - * ASYMMETRIC_DECRYPT. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CryptoKeyVersion public key to - * get. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [PublicKey]{@link google.cloud.kms.v1.PublicKey}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PublicKey]{@link google.cloud.kms.v1.PublicKey}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * client.getPublicKey({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getPublicKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getPublicKey(request, options, callback); - } - - /** - * Decrypts data that was encrypted with a public key retrieved from - * GetPublicKey corresponding to a CryptoKeyVersion with - * CryptoKey.purpose ASYMMETRIC_DECRYPT. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKeyVersion to use for - * decryption. - * @param {Buffer} request.ciphertext - * Required. The data encrypted with the named CryptoKeyVersion's public - * key using OAEP. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AsymmetricDecryptResponse]{@link google.cloud.kms.v1.AsymmetricDecryptResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AsymmetricDecryptResponse]{@link google.cloud.kms.v1.AsymmetricDecryptResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * const ciphertext = Buffer.from(''); - * const request = { - * name: formattedName, - * ciphertext: ciphertext, - * }; - * client.asymmetricDecrypt(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - asymmetricDecrypt(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.asymmetricDecrypt(request, options, callback); - } - - /** - * Signs data using a CryptoKeyVersion with CryptoKey.purpose - * ASYMMETRIC_SIGN, producing a signature that can be verified with the public - * key retrieved from GetPublicKey. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the CryptoKeyVersion to use for signing. - * @param {Object} request.digest - * Required. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * algorithm. - * - * This object should have the same structure as [Digest]{@link google.cloud.kms.v1.Digest} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AsymmetricSignResponse]{@link google.cloud.kms.v1.AsymmetricSignResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AsymmetricSignResponse]{@link google.cloud.kms.v1.AsymmetricSignResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.cryptoKeyVersionPath('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * const digest = {}; - * const request = { - * name: formattedName, - * digest: digest, - * }; - * client.asymmetricSign(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - asymmetricSign(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.asymmetricSign(request, options, callback); - } - - /** - * Sets the access control policy on the specified resource. Replaces - * any existing policy. - * - * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and - * PERMISSION_DENIED - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {Object} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * 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 [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.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 - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const kms = require('@google-cloud/kms'); - * - * const client = new kms.v1.KeyManagementServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.keyRingPath('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified crypto_key resource name string. - * - * @param {String} project - * @param {String} location - * @param {String} keyRing - * @param {String} cryptoKey - * @returns {String} - */ - cryptoKeyPath(project, location, keyRing, cryptoKey) { - return this._pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Return a fully-qualified crypto_key_path resource name string. - * - * @param {String} project - * @param {String} location - * @param {String} keyRing - * @param {String} cryptoKeyPath - * @returns {String} - */ - cryptoKeyPathPath(project, location, keyRing, cryptoKeyPath) { - return this._pathTemplates.cryptoKeyPathPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key_path: cryptoKeyPath, - }); - } - - /** - * Return a fully-qualified crypto_key_version resource name string. - * - * @param {String} project - * @param {String} location - * @param {String} keyRing - * @param {String} cryptoKey - * @param {String} cryptoKeyVersion - * @returns {String} - */ - cryptoKeyVersionPath( - project, - location, - keyRing, - cryptoKey, - cryptoKeyVersion - ) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - crypto_key_version: cryptoKeyVersion, - }); - } - - /** - * Return a fully-qualified import_job resource name string. - * - * @param {String} project - * @param {String} location - * @param {String} keyRing - * @param {String} importJob - * @returns {String} - */ - importJobPath(project, location, keyRing, importJob) { - return this._pathTemplates.importJobPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - import_job: importJob, - }); - } - - /** - * Return a fully-qualified key_ring resource name string. - * - * @param {String} project - * @param {String} location - * @param {String} keyRing - * @returns {String} - */ - keyRingPath(project, location, keyRing) { - return this._pathTemplates.keyRingPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - }); - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {String} project - * @param {String} location - * @returns {String} - */ - locationPath(project, location) { - return this._pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the cryptoKeyName from a crypto_key resource. - * - * @param {String} cryptoKeyName - * A fully-qualified path representing a crypto_key resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName) { - return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) - .project; - } - - /** - * Parse the cryptoKeyName from a crypto_key resource. - * - * @param {String} cryptoKeyName - * A fully-qualified path representing a crypto_key resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName) { - return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) - .location; - } - - /** - * Parse the cryptoKeyName from a crypto_key resource. - * - * @param {String} cryptoKeyName - * A fully-qualified path representing a crypto_key resources. - * @returns {String} - A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName) { - return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) - .key_ring; - } - - /** - * Parse the cryptoKeyName from a crypto_key resource. - * - * @param {String} cryptoKeyName - * A fully-qualified path representing a crypto_key resources. - * @returns {String} - A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName) { - return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) - .crypto_key; - } - - /** - * Parse the cryptoKeyPathName from a crypto_key_path resource. - * - * @param {String} cryptoKeyPathName - * A fully-qualified path representing a crypto_key_path resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromCryptoKeyPathName(cryptoKeyPathName) { - return this._pathTemplates.cryptoKeyPathPathTemplate.match( - cryptoKeyPathName - ).project; - } - - /** - * Parse the cryptoKeyPathName from a crypto_key_path resource. - * - * @param {String} cryptoKeyPathName - * A fully-qualified path representing a crypto_key_path resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromCryptoKeyPathName(cryptoKeyPathName) { - return this._pathTemplates.cryptoKeyPathPathTemplate.match( - cryptoKeyPathName - ).location; - } - - /** - * Parse the cryptoKeyPathName from a crypto_key_path resource. - * - * @param {String} cryptoKeyPathName - * A fully-qualified path representing a crypto_key_path resources. - * @returns {String} - A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyPathName(cryptoKeyPathName) { - return this._pathTemplates.cryptoKeyPathPathTemplate.match( - cryptoKeyPathName - ).key_ring; - } - - /** - * Parse the cryptoKeyPathName from a crypto_key_path resource. - * - * @param {String} cryptoKeyPathName - * A fully-qualified path representing a crypto_key_path resources. - * @returns {String} - A string representing the crypto_key_path. - */ - matchCryptoKeyPathFromCryptoKeyPathName(cryptoKeyPathName) { - return this._pathTemplates.cryptoKeyPathPathTemplate.match( - cryptoKeyPathName - ).crypto_key_path; - } - - /** - * Parse the cryptoKeyVersionName from a crypto_key_version resource. - * - * @param {String} cryptoKeyVersionName - * A fully-qualified path representing a crypto_key_version resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.match( - cryptoKeyVersionName - ).project; - } - - /** - * Parse the cryptoKeyVersionName from a crypto_key_version resource. - * - * @param {String} cryptoKeyVersionName - * A fully-qualified path representing a crypto_key_version resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.match( - cryptoKeyVersionName - ).location; - } - - /** - * Parse the cryptoKeyVersionName from a crypto_key_version resource. - * - * @param {String} cryptoKeyVersionName - * A fully-qualified path representing a crypto_key_version resources. - * @returns {String} - A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.match( - cryptoKeyVersionName - ).key_ring; - } - - /** - * Parse the cryptoKeyVersionName from a crypto_key_version resource. - * - * @param {String} cryptoKeyVersionName - * A fully-qualified path representing a crypto_key_version resources. - * @returns {String} - A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.match( - cryptoKeyVersionName - ).crypto_key; - } - - /** - * Parse the cryptoKeyVersionName from a crypto_key_version resource. - * - * @param {String} cryptoKeyVersionName - * A fully-qualified path representing a crypto_key_version resources. - * @returns {String} - A string representing the crypto_key_version. - */ - matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName) { - return this._pathTemplates.cryptoKeyVersionPathTemplate.match( - cryptoKeyVersionName - ).crypto_key_version; - } - - /** - * Parse the importJobName from a import_job resource. - * - * @param {String} importJobName - * A fully-qualified path representing a import_job resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromImportJobName(importJobName) { - return this._pathTemplates.importJobPathTemplate.match(importJobName) - .project; - } - - /** - * Parse the importJobName from a import_job resource. - * - * @param {String} importJobName - * A fully-qualified path representing a import_job resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromImportJobName(importJobName) { - return this._pathTemplates.importJobPathTemplate.match(importJobName) - .location; - } - - /** - * Parse the importJobName from a import_job resource. - * - * @param {String} importJobName - * A fully-qualified path representing a import_job resources. - * @returns {String} - A string representing the key_ring. - */ - matchKeyRingFromImportJobName(importJobName) { - return this._pathTemplates.importJobPathTemplate.match(importJobName) - .key_ring; - } - - /** - * Parse the importJobName from a import_job resource. - * - * @param {String} importJobName - * A fully-qualified path representing a import_job resources. - * @returns {String} - A string representing the import_job. - */ - matchImportJobFromImportJobName(importJobName) { - return this._pathTemplates.importJobPathTemplate.match(importJobName) - .import_job; - } - - /** - * Parse the keyRingName from a key_ring resource. - * - * @param {String} keyRingName - * A fully-qualified path representing a key_ring resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromKeyRingName(keyRingName) { - return this._pathTemplates.keyRingPathTemplate.match(keyRingName).project; - } - - /** - * Parse the keyRingName from a key_ring resource. - * - * @param {String} keyRingName - * A fully-qualified path representing a key_ring resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromKeyRingName(keyRingName) { - return this._pathTemplates.keyRingPathTemplate.match(keyRingName).location; - } - - /** - * Parse the keyRingName from a key_ring resource. - * - * @param {String} keyRingName - * A fully-qualified path representing a key_ring resources. - * @returns {String} - A string representing the key_ring. - */ - matchKeyRingFromKeyRingName(keyRingName) { - return this._pathTemplates.keyRingPathTemplate.match(keyRingName).key_ring; - } - - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the locationName from a location resource. - * - * @param {String} locationName - * A fully-qualified path representing a location resources. - * @returns {String} - A string representing the location. - */ - matchLocationFromLocationName(locationName) { - return this._pathTemplates.locationPathTemplate.match(locationName) - .location; - } -} - -module.exports = KeyManagementServiceClient; diff --git a/packages/google-cloud-kms/src/v1/key_management_service_client.ts b/packages/google-cloud-kms/src/v1/key_management_service_client.ts new file mode 100644 index 00000000000..f707f2c058c --- /dev/null +++ b/packages/google-cloud-kms/src/v1/key_management_service_client.ts @@ -0,0 +1,2963 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './key_management_service_client_config.json'; +import {IamClient} from '../helper'; + +const version = require('../../../package.json').version; + +/** + * Google Cloud Key Management Service + * + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * * [ImportJob][google.cloud.kms.v1.ImportJob] + * + * If you are using manual gRPC libraries, see + * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + * @class + * @memberof v1 + */ +export class KeyManagementServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + private _iamClient: IamClient; + auth: gax.GoogleAuth; + keyManagementServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of KeyManagementServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof KeyManagementServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof KeyManagementServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + this._iamClient = new IamClient(opts); + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + cryptoKeyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + cryptoKeyVersionPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' + ), + importJobPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}' + ), + keyRingPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}' + ), + locationPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listKeyRings: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keyRings' + ), + listCryptoKeys: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cryptoKeys' + ), + listCryptoKeyVersions: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cryptoKeyVersions' + ), + listImportJobs: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'importJobs' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.kms.v1.KeyManagementService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.kms.v1.KeyManagementService. + this.keyManagementServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.kms.v1.KeyManagementService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.kms.v1.KeyManagementService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const keyManagementServiceStubMethods = [ + 'listKeyRings', + 'listCryptoKeys', + 'listCryptoKeyVersions', + 'listImportJobs', + 'getKeyRing', + 'getCryptoKey', + 'getCryptoKeyVersion', + 'getPublicKey', + 'getImportJob', + 'createKeyRing', + 'createCryptoKey', + 'createCryptoKeyVersion', + 'importCryptoKeyVersion', + 'createImportJob', + 'updateCryptoKey', + 'updateCryptoKeyVersion', + 'encrypt', + 'decrypt', + 'asymmetricSign', + 'asymmetricDecrypt', + 'updateCryptoKeyPrimaryVersion', + 'destroyCryptoKeyVersion', + 'restoreCryptoKeyVersion', + ]; + + for (const methodName of keyManagementServiceStubMethods) { + const innerCallPromise = this.keyManagementServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudkms.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudkms.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getKeyRing( + request: protosTypes.google.cloud.kms.v1.IGetKeyRingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.IGetKeyRingRequest | undefined, + {} | undefined + ] + >; + getKeyRing( + request: protosTypes.google.cloud.kms.v1.IGetKeyRingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.IGetKeyRingRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * @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 [KeyRing]{@link google.cloud.kms.v1.KeyRing}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getKeyRing( + request: protosTypes.google.cloud.kms.v1.IGetKeyRingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.IGetKeyRingRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.IGetKeyRingRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.IGetKeyRingRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getKeyRing(request, options, callback); + } + getCryptoKey( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest | undefined, + {} | undefined + ] + >; + getCryptoKey( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its + * [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getCryptoKey( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getCryptoKey(request, options, callback); + } + getCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest | undefined, + {} | undefined + ] + >; + getCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getCryptoKeyVersion(request, options, callback); + } + getPublicKey( + request: protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IPublicKey, + protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest | undefined, + {} | undefined + ] + >; + getPublicKey( + request: protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IPublicKey, + protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to + * get. + * @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 [PublicKey]{@link google.cloud.kms.v1.PublicKey}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getPublicKey( + request: protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IPublicKey, + protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IPublicKey, + protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IPublicKey, + protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getPublicKey(request, options, callback); + } + getImportJob( + request: protosTypes.google.cloud.kms.v1.IGetImportJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.IGetImportJobRequest | undefined, + {} | undefined + ] + >; + getImportJob( + request: protosTypes.google.cloud.kms.v1.IGetImportJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.IGetImportJobRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * @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 [ImportJob]{@link google.cloud.kms.v1.ImportJob}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getImportJob( + request: protosTypes.google.cloud.kms.v1.IGetImportJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.IGetImportJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.IGetImportJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.IGetImportJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getImportJob(request, options, callback); + } + createKeyRing( + request: protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest | undefined, + {} | undefined + ] + >; + createKeyRing( + request: protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest | undefined, + {} | undefined + > + ): void; + /** + * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/* /locations/*`. + * @param {string} request.keyRingId + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.kms.v1.KeyRing} request.keyRing + * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + * @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 [KeyRing]{@link google.cloud.kms.v1.KeyRing}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createKeyRing( + request: protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing, + protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createKeyRing(request, options, callback); + } + createCryptoKey( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest | undefined, + {} | undefined + ] + >; + createCryptoKey( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest | undefined, + {} | undefined + > + ): void; + /** + * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * @param {string} request.cryptoKeyId + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.kms.v1.CryptoKey} request.cryptoKey + * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + * @param {boolean} request.skipInitialVersionCreation + * If set to true, the request will create a [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createCryptoKey( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createCryptoKey(request, options, callback); + } + createCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + >; + createCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * @param {google.cloud.kms.v1.CryptoKeyVersion} request.cryptoKeyVersion + * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createCryptoKeyVersion( + request, + options, + callback + ); + } + importCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + >; + importCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Imports a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] into an existing [CryptoKey][google.cloud.kms.v1.CryptoKey] using the + * wrapped key material provided in the request. + * + * The version ID will be assigned the next sequential id within the + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to + * be imported into. + * @param {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} request.algorithm + * Required. The [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] of + * the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] this + * version imports into. + * @param {string} request.importJob + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] that was used to + * wrap this key material. + * @param {Buffer} request.rsaAesWrappedKey + * Wrapped key material produced with + * [RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256]. + * + * This field contains the concatenation of two wrapped keys: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP with SHA-1, + * MGF1 with SHA-1, and an empty label. + *
  2. + *
  3. The key to be imported, wrapped with the ephemeral AES-256 key + * using AES-KWP (RFC 5649). + *
  4. + *
+ * + * If importing symmetric key material, it is expected that the unwrapped + * key contains plain bytes. If importing asymmetric key material, it is + * expected that the unwrapped key is in PKCS#8-encoded DER format (the + * PrivateKeyInfo structure from RFC 5208). + * + * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + importCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.importCryptoKeyVersion( + request, + options, + callback + ); + } + createImportJob( + request: protosTypes.google.cloud.kms.v1.ICreateImportJobRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.ICreateImportJobRequest | undefined, + {} | undefined + ] + >; + createImportJob( + request: protosTypes.google.cloud.kms.v1.ICreateImportJobRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.ICreateImportJobRequest | undefined, + {} | undefined + > + ): void; + /** + * Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * @param {string} request.importJobId + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.kms.v1.ImportJob} request.importJob + * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. + * @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 [ImportJob]{@link google.cloud.kms.v1.ImportJob}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createImportJob( + request: protosTypes.google.cloud.kms.v1.ICreateImportJobRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.ICreateImportJobRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.ICreateImportJobRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob, + protosTypes.google.cloud.kms.v1.ICreateImportJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createImportJob(request, options, callback); + } + updateCryptoKey( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest | undefined, + {} | undefined + ] + >; + updateCryptoKey( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest | undefined, + {} | undefined + > + ): void; + /** + * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.kms.v1.CryptoKey} request.cryptoKey + * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields to be updated in this request. + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateCryptoKey( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'crypto_key.name': request.cryptoKey!.name || '', + }); + return this._innerApiCalls.updateCryptoKey(request, options, callback); + } + updateCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + >; + updateCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + * + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this + * method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to + * move between other states. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.kms.v1.CryptoKeyVersion} request.cryptoKeyVersion + * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields to be updated in this request. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'crypto_key_version.name': request.cryptoKeyVersion!.name || '', + }); + return this._innerApiCalls.updateCryptoKeyVersion( + request, + options, + callback + ); + } + encrypt( + request: protosTypes.google.cloud.kms.v1.IEncryptRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IEncryptResponse, + protosTypes.google.cloud.kms.v1.IEncryptRequest | undefined, + {} | undefined + ] + >; + encrypt( + request: protosTypes.google.cloud.kms.v1.IEncryptRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IEncryptResponse, + protosTypes.google.cloud.kms.v1.IEncryptRequest | undefined, + {} | undefined + > + ): void; + /** + * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * to use for encryption. + * + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its + * [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * @param {Buffer} request.plaintext + * Required. The data to encrypt. Must be no larger than 64KiB. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger + * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the + * plaintext and additional_authenticated_data fields must be no larger than + * 8KiB. + * @param {Buffer} [request.additionalAuthenticatedData] + * Optional. Optional data that, if specified, must also be provided during decryption + * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than + * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the + * plaintext and additional_authenticated_data fields must be no larger than + * 8KiB. + * @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 [EncryptResponse]{@link google.cloud.kms.v1.EncryptResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + encrypt( + request: protosTypes.google.cloud.kms.v1.IEncryptRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IEncryptResponse, + protosTypes.google.cloud.kms.v1.IEncryptRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IEncryptResponse, + protosTypes.google.cloud.kms.v1.IEncryptRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IEncryptResponse, + protosTypes.google.cloud.kms.v1.IEncryptRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.encrypt(request, options, callback); + } + decrypt( + request: protosTypes.google.cloud.kms.v1.IDecryptRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IDecryptResponse, + protosTypes.google.cloud.kms.v1.IDecryptRequest | undefined, + {} | undefined + ] + >; + decrypt( + request: protosTypes.google.cloud.kms.v1.IDecryptRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IDecryptResponse, + protosTypes.google.cloud.kms.v1.IDecryptRequest | undefined, + {} | undefined + > + ): void; + /** + * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + * @param {Buffer} request.ciphertext + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * @param {Buffer} [request.additionalAuthenticatedData] + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * @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 [DecryptResponse]{@link google.cloud.kms.v1.DecryptResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + decrypt( + request: protosTypes.google.cloud.kms.v1.IDecryptRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IDecryptResponse, + protosTypes.google.cloud.kms.v1.IDecryptRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IDecryptResponse, + protosTypes.google.cloud.kms.v1.IDecryptRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IDecryptResponse, + protosTypes.google.cloud.kms.v1.IDecryptRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.decrypt(request, options, callback); + } + asymmetricSign( + request: protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IAsymmetricSignResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest | undefined, + {} | undefined + ] + >; + asymmetricSign( + request: protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricSignResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest | undefined, + {} | undefined + > + ): void; + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_SIGN, producing a signature that can be verified with the public + * key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. + * @param {google.cloud.kms.v1.Digest} request.digest + * Required. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * @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 [AsymmetricSignResponse]{@link google.cloud.kms.v1.AsymmetricSignResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + asymmetricSign( + request: protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricSignResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricSignResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IAsymmetricSignResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.asymmetricSign(request, options, callback); + } + asymmetricDecrypt( + request: protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest | undefined, + {} | undefined + ] + >; + asymmetricDecrypt( + request: protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest | undefined, + {} | undefined + > + ): void; + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * @param {Buffer} request.ciphertext + * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public + * key using OAEP. + * @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 [AsymmetricDecryptResponse]{@link google.cloud.kms.v1.AsymmetricDecryptResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + asymmetricDecrypt( + request: protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptResponse, + protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.asymmetricDecrypt(request, options, callback); + } + updateCryptoKeyPrimaryVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + ( + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest + | undefined + ), + {} | undefined + ] + >; + updateCryptoKeyPrimaryVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + * Returns an error if called on an asymmetric key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * @param {string} request.cryptoKeyVersionId + * Required. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateCryptoKeyPrimaryVersion( + request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey, + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey, + ( + | protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.updateCryptoKeyPrimaryVersion( + request, + options, + callback + ); + } + destroyCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + >; + destroyCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + * + * Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 + * hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be changed to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key + * material will be irrevocably destroyed. + * + * Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + destroyCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.destroyCryptoKeyVersion( + request, + options, + callback + ); + } + restoreCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + >; + restoreCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state. + * + * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + restoreCryptoKeyVersion( + request: protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + | protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion, + ( + | protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.restoreCryptoKeyVersion( + request, + options, + callback + ); + } + + listKeyRings( + request: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing[], + protosTypes.google.cloud.kms.v1.IListKeyRingsRequest | null, + protosTypes.google.cloud.kms.v1.IListKeyRingsResponse + ] + >; + listKeyRings( + request: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing[], + protosTypes.google.cloud.kms.v1.IListKeyRingsRequest | null, + protosTypes.google.cloud.kms.v1.IListKeyRingsResponse + > + ): void; + /** + * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [KeyRings][google.cloud.kms.v1.KeyRing] to include in the + * response. Further [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [KeyRing]{@link google.cloud.kms.v1.KeyRing}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [KeyRing]{@link google.cloud.kms.v1.KeyRing} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListKeyRingsRequest]{@link google.cloud.kms.v1.ListKeyRingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListKeyRingsResponse]{@link google.cloud.kms.v1.ListKeyRingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listKeyRings( + request: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IKeyRing[], + protosTypes.google.cloud.kms.v1.IListKeyRingsRequest | null, + protosTypes.google.cloud.kms.v1.IListKeyRingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IKeyRing[], + protosTypes.google.cloud.kms.v1.IListKeyRingsRequest | null, + protosTypes.google.cloud.kms.v1.IListKeyRingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IKeyRing[], + protosTypes.google.cloud.kms.v1.IListKeyRingsRequest | null, + protosTypes.google.cloud.kms.v1.IListKeyRingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listKeyRings(request, options, callback); + } + + /** + * Equivalent to {@link listKeyRings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeyRings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [KeyRings][google.cloud.kms.v1.KeyRing] to include in the + * response. Further [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [KeyRing]{@link google.cloud.kms.v1.KeyRing} on 'data' event. + */ + listKeyRingsStream( + request?: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listKeyRings.createStream( + this._innerApiCalls.listKeyRings as gax.GaxCall, + request, + callSettings + ); + } + listCryptoKeys( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey[], + protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeysResponse + ] + >; + listCryptoKeys( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey[], + protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeysResponse + > + ): void; + /** + * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] to list, in the format + * `projects/* /locations/* /keyRings/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the + * response. Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be obtained by + * including the [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * @param {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} request.versionView + * The fields of the primary version to include in the response. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListCryptoKeysRequest]{@link google.cloud.kms.v1.ListCryptoKeysRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListCryptoKeysResponse]{@link google.cloud.kms.v1.ListCryptoKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listCryptoKeys( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey[], + protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeysResponse + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKey[], + protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeysResponse + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKey[], + protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeysResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listCryptoKeys(request, options, callback); + } + + /** + * Equivalent to {@link listCryptoKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listCryptoKeys} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] to list, in the format + * `projects/* /locations/* /keyRings/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the + * response. Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be obtained by + * including the [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * @param {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} request.versionView + * The fields of the primary version to include in the response. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [CryptoKey]{@link google.cloud.kms.v1.CryptoKey} on 'data' event. + */ + listCryptoKeysStream( + request?: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listCryptoKeys.createStream( + this._innerApiCalls.listCryptoKeys as gax.GaxCall, + request, + callSettings + ); + } + listCryptoKeyVersions( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion[], + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsResponse + ] + >; + listCryptoKeyVersions( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion[], + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsResponse + > + ): void; + /** + * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to + * include in the response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] can + * subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] in a subsequent request. + * If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * @param {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} request.view + * The fields to include in the response. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListCryptoKeyVersionsRequest]{@link google.cloud.kms.v1.ListCryptoKeyVersionsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListCryptoKeyVersionsResponse]{@link google.cloud.kms.v1.ListCryptoKeyVersionsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listCryptoKeyVersions( + request: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion[], + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsResponse + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion[], + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsResponse + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.ICryptoKeyVersion[], + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest | null, + protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listCryptoKeyVersions( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listCryptoKeyVersions}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listCryptoKeyVersions} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/* /locations/* /keyRings/* /cryptoKeys/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to + * include in the response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] can + * subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] in a subsequent request. + * If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * @param {google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} request.view + * The fields to include in the response. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [CryptoKeyVersion]{@link google.cloud.kms.v1.CryptoKeyVersion} on 'data' event. + */ + listCryptoKeyVersionsStream( + request?: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listCryptoKeyVersions.createStream( + this._innerApiCalls.listCryptoKeyVersions as gax.GaxCall, + request, + callSettings + ); + } + listImportJobs( + request: protosTypes.google.cloud.kms.v1.IListImportJobsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob[], + protosTypes.google.cloud.kms.v1.IListImportJobsRequest | null, + protosTypes.google.cloud.kms.v1.IListImportJobsResponse + ] + >; + listImportJobs( + request: protosTypes.google.cloud.kms.v1.IListImportJobsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.kms.v1.IImportJob[], + protosTypes.google.cloud.kms.v1.IListImportJobsRequest | null, + protosTypes.google.cloud.kms.v1.IListImportJobsResponse + > + ): void; + /** + * Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] to list, in the format + * `projects/* /locations/* /keyRings/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the + * response. Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be obtained by + * including the [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [ImportJob]{@link google.cloud.kms.v1.ImportJob}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ImportJob]{@link google.cloud.kms.v1.ImportJob} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListImportJobsRequest]{@link google.cloud.kms.v1.ListImportJobsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListImportJobsResponse]{@link google.cloud.kms.v1.ListImportJobsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listImportJobs( + request: protosTypes.google.cloud.kms.v1.IListImportJobsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.kms.v1.IImportJob[], + protosTypes.google.cloud.kms.v1.IListImportJobsRequest | null, + protosTypes.google.cloud.kms.v1.IListImportJobsResponse + >, + callback?: Callback< + protosTypes.google.cloud.kms.v1.IImportJob[], + protosTypes.google.cloud.kms.v1.IListImportJobsRequest | null, + protosTypes.google.cloud.kms.v1.IListImportJobsResponse + > + ): Promise< + [ + protosTypes.google.cloud.kms.v1.IImportJob[], + protosTypes.google.cloud.kms.v1.IListImportJobsRequest | null, + protosTypes.google.cloud.kms.v1.IListImportJobsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listImportJobs(request, options, callback); + } + + /** + * Equivalent to {@link listImportJobs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listImportJobs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] to list, in the format + * `projects/* /locations/* /keyRings/*`. + * @param {number} [request.pageSize] + * Optional. Optional limit on the number of [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the + * response. Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be obtained by + * including the [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @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 [ImportJob]{@link google.cloud.kms.v1.ImportJob} on 'data' event. + */ + listImportJobsStream( + request?: protosTypes.google.cloud.kms.v1.IListImportJobsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listImportJobs.createStream( + this._innerApiCalls.listImportJobs as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string + ) { + return this._pathTemplates.cryptoKeyPathTemplate.render({ + project, + location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this._pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .crypto_key; + } + + /** + * Return a fully-qualified cryptoKeyVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @param {string} crypto_key_version + * @returns {string} Resource name string. + */ + cryptoKeyVersionPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string, + cryptoKeyVersion: string + ) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.render({ + project, + location, + key_ring: keyRing, + crypto_key: cryptoKey, + crypto_key_version: cryptoKeyVersion, + }); + } + + /** + * Parse the project from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.match( + cryptoKeyVersionName + ).project; + } + + /** + * Parse the location from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.match( + cryptoKeyVersionName + ).location; + } + + /** + * Parse the key_ring from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.match( + cryptoKeyVersionName + ).key_ring; + } + + /** + * Parse the crypto_key from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.match( + cryptoKeyVersionName + ).crypto_key; + } + + /** + * Parse the crypto_key_version from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key_version. + */ + matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this._pathTemplates.cryptoKeyVersionPathTemplate.match( + cryptoKeyVersionName + ).crypto_key_version; + } + + /** + * Return a fully-qualified importJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} import_job + * @returns {string} Resource name string. + */ + importJobPath( + project: string, + location: string, + keyRing: string, + importJob: string + ) { + return this._pathTemplates.importJobPathTemplate.render({ + project, + location, + key_ring: keyRing, + import_job: importJob, + }); + } + + /** + * Parse the project from ImportJob resource. + * + * @param {string} importJobName + * A fully-qualified path representing ImportJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromImportJobName(importJobName: string) { + return this._pathTemplates.importJobPathTemplate.match(importJobName) + .project; + } + + /** + * Parse the location from ImportJob resource. + * + * @param {string} importJobName + * A fully-qualified path representing ImportJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromImportJobName(importJobName: string) { + return this._pathTemplates.importJobPathTemplate.match(importJobName) + .location; + } + + /** + * Parse the key_ring from ImportJob resource. + * + * @param {string} importJobName + * A fully-qualified path representing ImportJob resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromImportJobName(importJobName: string) { + return this._pathTemplates.importJobPathTemplate.match(importJobName) + .key_ring; + } + + /** + * Parse the import_job from ImportJob resource. + * + * @param {string} importJobName + * A fully-qualified path representing ImportJob resource. + * @returns {string} A string representing the import_job. + */ + matchImportJobFromImportJobName(importJobName: string) { + return this._pathTemplates.importJobPathTemplate.match(importJobName) + .import_job; + } + + /** + * Return a fully-qualified keyRing resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @returns {string} Resource name string. + */ + keyRingPath(project: string, location: string, keyRing: string) { + return this._pathTemplates.keyRingPathTemplate.render({ + project, + location, + key_ring: keyRing, + }); + } + + /** + * Parse the project from KeyRing resource. + * + * @param {string} keyRingName + * A fully-qualified path representing KeyRing resource. + * @returns {string} A string representing the project. + */ + matchProjectFromKeyRingName(keyRingName: string) { + return this._pathTemplates.keyRingPathTemplate.match(keyRingName).project; + } + + /** + * Parse the location from KeyRing resource. + * + * @param {string} keyRingName + * A fully-qualified path representing KeyRing resource. + * @returns {string} A string representing the location. + */ + matchLocationFromKeyRingName(keyRingName: string) { + return this._pathTemplates.keyRingPathTemplate.match(keyRingName).location; + } + + /** + * Parse the key_ring from KeyRing resource. + * + * @param {string} keyRingName + * A fully-qualified path representing KeyRing resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromKeyRingName(keyRingName: string) { + return this._pathTemplates.keyRingPathTemplate.match(keyRingName).key_ring; + } + + /** + * 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, + 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; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.keyManagementServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/packages/google-cloud-kms/src/v1/key_management_service_client_config.json b/packages/google-cloud-kms/src/v1/key_management_service_client_config.json index 8811068a9bf..f71290a313b 100644 --- a/packages/google-cloud-kms/src/v1/key_management_service_client_config.json +++ b/packages/google-cloud-kms/src/v1/key_management_service_client_config.json @@ -2,158 +2,114 @@ "interfaces": { "google.cloud.kms.v1.KeyManagementService": { "retry_codes": { - "retryable": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "UNAVAILABLE" - ], + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [], - "non_retryable": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListKeyRings": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", - "retry_params_name": "default" - }, - "ListImportJobs": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListCryptoKeys": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListCryptoKeyVersions": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "GetKeyRing": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "ListImportJobs": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "GetImportJob": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "GetKeyRing": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "CreateKeyRing": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "GetPublicKey": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "CreateImportJob": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "GetImportJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateKeyRing": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ImportCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_retryable", + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateImportJob": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "Encrypt": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "Decrypt": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", - "retry_params_name": "default" - }, - "UpdateCryptoKeyPrimaryVersion": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "DestroyCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", - "retry_params_name": "default" - }, - "RestoreCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", - "retry_params_name": "default" - }, - "GetPublicKey": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "AsymmetricSign": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "AsymmetricDecrypt": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "AsymmetricSign": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "UpdateCryptoKeyPrimaryVersion": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "DestroyCryptoKeyVersion": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retryable", + "RestoreCryptoKeyVersion": { + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-kms/src/v1/key_management_service_proto_list.json b/packages/google-cloud-kms/src/v1/key_management_service_proto_list.json index d4ec79e0751..5c2bbcac90f 100644 --- a/packages/google-cloud-kms/src/v1/key_management_service_proto_list.json +++ b/packages/google-cloud-kms/src/v1/key_management_service_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/kms/v1/resources.proto", "../../protos/google/cloud/kms/v1/service.proto", - "../../protos/google/iam/v1/iam_policy.proto" + "../../protos/google/iam/v1/logging/audit_data.proto" ] diff --git a/packages/google-cloud-kms/synth.metadata b/packages/google-cloud-kms/synth.metadata index f1a4940c046..cf71f249275 100644 --- a/packages/google-cloud-kms/synth.metadata +++ b/packages/google-cloud-kms/synth.metadata @@ -1,20 +1,12 @@ { - "updateTime": "2020-02-29T12:30:40.016680Z", + "updateTime": "2020-03-04T23:33:59.146435Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.47.0", - "dockerImage": "googleapis/artman@sha256:b3e50d6b8de03920b9f065bbc3d210e2ca93a043446f1fa16cdf567393c09678" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n" + "sha": "dcc5d00fc8a8d8b56f16194d7c682027b2c66a3b", + "internalRef": "298953301" } }, { @@ -31,9 +23,8 @@ "source": "googleapis", "apiName": "kms", "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/kms/artman_cloudkms.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ] diff --git a/packages/google-cloud-kms/synth.py b/packages/google-cloud-kms/synth.py index 74a0a13c2d0..1bf06d33bd1 100644 --- a/packages/google-cloud-kms/synth.py +++ b/packages/google-cloud-kms/synth.py @@ -18,25 +18,63 @@ import synthtool.gcp as gcp import logging import subprocess +import json +import os logging.basicConfig(level=logging.DEBUG) -gapic = gcp.GAPICGenerator() -version = 'v1' -library = gapic.node_library( - 'kms', version, - config_path='artman_cloudkms.yaml') -# skip index, package.json, and README.md -s.copy( - library, - excludes=['package.json', 'README.md', 'src/index.js'], -) +gapic = gcp.GAPICMicrogenerator() +versions = ['v1'] +for version in versions: + library = gapic.typescript_library( + 'kms', version, + generator_args={ + "grpc-service-config": f"google/cloud/kms/{version}/cloudkms_grpc_service_config.json", + "package-name": f"@google-cloud/kms" + }, + proto_path=f'/google/cloud/kms/{version}', + extra_proto_files=['google/cloud/common_resources.proto', 'google/iam/v1'] + ) + # skip index, package.json, and README.md + s.copy( + library, + excludes=['package.json', 'README.md', 'src/index.ts'], + ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) +# Remove unneeded protos in proto_list.json +# In micro-generators, we do have default multiple common protos set as dependencies. +# But if the proto is also specified in protoc command (used to generating client libraries), +# protoc command will fail becasue of the repetition and force us to remove the duplicate protos reference +list_json='src/v1/key_management_service_proto_list.json' +remove_proto_keywords=['/google/api', '/google/protobuf', 'google/type'] +with open(list_json, 'r') as f: + items=json.load(f) + content =[item for item in items if all([(x not in item) for x in remove_proto_keywords])] + new_file=json.dumps(content, indent=2) + '\n' +with open(list_json, 'w') as f: + f.write(new_file) +# surgery in client.ts file +client_file='src/v1/key_management_service_client.ts' +s.replace(client_file, +'import \* as gapicConfig from \'\.\/key_management_service_client_config\.json\';', +'import * as gapicConfig from \'./key_management_service_client_config.json\'; import {IamClient} from \'../helper\';') + +s.replace(client_file, +'private \_terminated = false;', +'private _terminated = false; \n private _iamClient: IamClient;') + +s.replace(client_file, +'\/\/ Determine the client header string.', +'this._iamClient = new IamClient(opts); \n // Determine the client header string.') + +with open('helperMethods.ts.tmpl', 'r') as helper_file: + content = helper_file.read() +s.replace(client_file, '^}', content) # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-kms/system-test/.eslintrc.yml b/packages/google-cloud-kms/system-test/.eslintrc.yml deleted file mode 100644 index 5adab99ca15..00000000000 --- a/packages/google-cloud-kms/system-test/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -rules: - node/no-unpublished-require: off - no-console: off diff --git a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-kms/system-test/fixtures/sample/src/index.js similarity index 56% rename from packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_iam_policy.js rename to packages/google-cloud-kms/system-test/fixtures/sample/src/index.js index 32288959104..68c53786eef 100644 --- a/packages/google-cloud-kms/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-kms/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,17 @@ // 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 kms = require('@google-cloud/kms'); + +function main() { + const keyManagementServiceClient = new kms.KeyManagementServiceClient(); +} -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. +main(); diff --git a/packages/google-cloud-kms/src/v1/index.js b/packages/google-cloud-kms/system-test/fixtures/sample/src/index.ts similarity index 59% rename from packages/google-cloud-kms/src/v1/index.js rename to packages/google-cloud-kms/system-test/fixtures/sample/src/index.ts index 4b194380407..78f220746b5 100644 --- a/packages/google-cloud-kms/src/v1/index.js +++ b/packages/google-cloud-kms/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,15 @@ // 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'; +import {KeyManagementServiceClient} from '@google-cloud/kms'; -const KeyManagementServiceClient = require('./key_management_service_client'); +function main() { + const keyManagementServiceClient = new KeyManagementServiceClient(); +} -module.exports.KeyManagementServiceClient = KeyManagementServiceClient; +main(); diff --git a/packages/google-cloud-kms/system-test/install.ts b/packages/google-cloud-kms/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-kms/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 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('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-kms/system-test/kms.js b/packages/google-cloud-kms/system-test/kms.ts similarity index 82% rename from packages/google-cloud-kms/system-test/kms.js rename to packages/google-cloud-kms/system-test/kms.ts index 79e95849dc2..21e62bbfbd3 100644 --- a/packages/google-cloud-kms/system-test/kms.js +++ b/packages/google-cloud-kms/system-test/kms.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -const kms = require('../src'); -const assert = require('assert'); -const {describe, it} = require('mocha'); +import * as kms from '../src'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; -const client = new kms.v1.KeyManagementServiceClient(); +const client = new kms.KeyManagementServiceClient(); describe('KMS system tests', () => { it('should list global key rings', async () => { diff --git a/packages/google-cloud-kms/test/gapic-key_management_iam_service.ts b/packages/google-cloud-kms/test/gapic-key_management_iam_service.ts new file mode 100644 index 00000000000..9524c0a356f --- /dev/null +++ b/packages/google-cloud-kms/test/gapic-key_management_iam_service.ts @@ -0,0 +1,124 @@ +// Copyright 2019 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 assert from 'assert'; +import {describe, it} from 'mocha'; +const keymanagementserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null | undefined, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1.KeyManagementServiceClient', () => { + it('call getIamPolicy', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request = {}; + // Mock response + const expectedResponse = undefined; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + it('call setIamPolicy', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request = {}; + // Mock response + const expectedResponse = undefined; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('call testIamPermissions', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request = {}; + // Mock response + const expectedResponse = undefined; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); +}); diff --git a/packages/google-cloud-kms/test/gapic-key_management_service-v1.ts b/packages/google-cloud-kms/test/gapic-key_management_service-v1.ts new file mode 100644 index 00000000000..bebf08b2f0b --- /dev/null +++ b/packages/google-cloud-kms/test/gapic-key_management_service-v1.ts @@ -0,0 +1,1341 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const keymanagementserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1.KeyManagementServiceClient', () => { + it('has servicePath', () => { + const servicePath = + keymanagementserviceModule.v1.KeyManagementServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + keymanagementserviceModule.v1.KeyManagementServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = keymanagementserviceModule.v1.KeyManagementServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + describe('getKeyRing', () => { + it('invokes getKeyRing without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetKeyRingRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKeyRing = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getKeyRing(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getKeyRing with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetKeyRingRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKeyRing = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getKeyRing(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getCryptoKey', () => { + it('invokes getCryptoKey without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCryptoKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getCryptoKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getCryptoKey with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCryptoKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getCryptoKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getCryptoKeyVersion', () => { + it('invokes getCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getCryptoKeyVersion(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getPublicKey', () => { + it('invokes getPublicKey without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getPublicKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getPublicKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getPublicKey with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetPublicKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getPublicKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getPublicKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getImportJob', () => { + it('invokes getImportJob without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetImportJobRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getImportJob = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getImportJob(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getImportJob with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IGetImportJobRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getImportJob = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getImportJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createKeyRing', () => { + it('invokes createKeyRing without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKeyRing = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createKeyRing(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createKeyRing with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateKeyRingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKeyRing = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createKeyRing(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createCryptoKey', () => { + it('invokes createCryptoKey without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCryptoKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createCryptoKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createCryptoKey with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCryptoKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createCryptoKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createCryptoKeyVersion', () => { + it('invokes createCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateCryptoKeyVersionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createCryptoKeyVersion(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('importCryptoKeyVersion', () => { + it('invokes importCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.importCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.importCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes importCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IImportCryptoKeyVersionRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.importCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.importCryptoKeyVersion(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createImportJob', () => { + it('invokes createImportJob without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateImportJobRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createImportJob = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createImportJob(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createImportJob with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.ICreateImportJobRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createImportJob = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createImportJob(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateCryptoKey', () => { + it('invokes updateCryptoKey without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest = {}; + request.cryptoKey = {}; + request.cryptoKey.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateCryptoKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateCryptoKey with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyRequest = {}; + request.cryptoKey = {}; + request.cryptoKey.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateCryptoKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateCryptoKeyVersion', () => { + it('invokes updateCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest = {}; + request.cryptoKeyVersion = {}; + request.cryptoKeyVersion.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyVersionRequest = {}; + request.cryptoKeyVersion = {}; + request.cryptoKeyVersion.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateCryptoKeyVersion(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('encrypt', () => { + it('invokes encrypt without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IEncryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.encrypt = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.encrypt(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes encrypt with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IEncryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.encrypt = mockSimpleGrpcMethod( + request, + null, + error + ); + client.encrypt(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('decrypt', () => { + it('invokes decrypt without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IDecryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.decrypt = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.decrypt(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes decrypt with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IDecryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.decrypt = mockSimpleGrpcMethod( + request, + null, + error + ); + client.decrypt(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('asymmetricSign', () => { + it('invokes asymmetricSign without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.asymmetricSign = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.asymmetricSign(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes asymmetricSign with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IAsymmetricSignRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.asymmetricSign = mockSimpleGrpcMethod( + request, + null, + error + ); + client.asymmetricSign(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('asymmetricDecrypt', () => { + it('invokes asymmetricDecrypt without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.asymmetricDecrypt = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.asymmetricDecrypt(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes asymmetricDecrypt with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IAsymmetricDecryptRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.asymmetricDecrypt = mockSimpleGrpcMethod( + request, + null, + error + ); + client.asymmetricDecrypt(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateCryptoKeyPrimaryVersion', () => { + it('invokes updateCryptoKeyPrimaryVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKeyPrimaryVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateCryptoKeyPrimaryVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateCryptoKeyPrimaryVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IUpdateCryptoKeyPrimaryVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateCryptoKeyPrimaryVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateCryptoKeyPrimaryVersion( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('destroyCryptoKeyVersion', () => { + it('invokes destroyCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.destroyCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.destroyCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes destroyCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IDestroyCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.destroyCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.destroyCryptoKeyVersion( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('restoreCryptoKeyVersion', () => { + it('invokes restoreCryptoKeyVersion without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.restoreCryptoKeyVersion = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.restoreCryptoKeyVersion(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes restoreCryptoKeyVersion with error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IRestoreCryptoKeyVersionRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.restoreCryptoKeyVersion = mockSimpleGrpcMethod( + request, + null, + error + ); + client.restoreCryptoKeyVersion( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('listKeyRings', () => { + it('invokes listKeyRings without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listKeyRings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listKeyRings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listKeyRingsStream', () => { + it('invokes listKeyRingsStream without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListKeyRingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listKeyRings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listKeyRingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listCryptoKeys', () => { + it('invokes listCryptoKeys without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listCryptoKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listCryptoKeys(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listCryptoKeysStream', () => { + it('invokes listCryptoKeysStream without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListCryptoKeysRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listCryptoKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listCryptoKeysStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listCryptoKeyVersions', () => { + it('invokes listCryptoKeyVersions without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listCryptoKeyVersions = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listCryptoKeyVersions(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listCryptoKeyVersionsStream', () => { + it('invokes listCryptoKeyVersionsStream without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListCryptoKeyVersionsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listCryptoKeyVersions = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listCryptoKeyVersionsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listImportJobs', () => { + it('invokes listImportJobs without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListImportJobsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listImportJobs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listImportJobs(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listImportJobsStream', () => { + it('invokes listImportJobsStream without error', done => { + const client = new keymanagementserviceModule.v1.KeyManagementServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.kms.v1.IListImportJobsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listImportJobs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listImportJobsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/packages/google-cloud-kms/test/gapic-v1.js b/packages/google-cloud-kms/test/gapic-v1.js deleted file mode 100644 index fcbbbe745de..00000000000 --- a/packages/google-cloud-kms/test/gapic-v1.js +++ /dev/null @@ -1,2014 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const kmsModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('KeyManagementServiceClient', () => { - it('has servicePath', () => { - const servicePath = kmsModule.v1.KeyManagementServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = kmsModule.v1.KeyManagementServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = kmsModule.v1.KeyManagementServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new kmsModule.v1.KeyManagementServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('listKeyRings', () => { - it('invokes listKeyRings without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const keyRingsElement = {}; - const keyRings = [keyRingsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - keyRings: keyRings, - }; - - // Mock Grpc layer - client._innerApiCalls.listKeyRings = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.keyRings); - }; - - client.listKeyRings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.keyRings); - done(); - }); - }); - - it('invokes listKeyRings with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listKeyRings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listKeyRings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listImportJobs', () => { - it('invokes listImportJobs without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const importJobsElement = {}; - const importJobs = [importJobsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - importJobs: importJobs, - }; - - // Mock Grpc layer - client._innerApiCalls.listImportJobs = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.importJobs); - }; - - client.listImportJobs(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.importJobs); - done(); - }); - }); - - it('invokes listImportJobs with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listImportJobs = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listImportJobs(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listCryptoKeys', () => { - it('invokes listCryptoKeys without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const cryptoKeysElement = {}; - const cryptoKeys = [cryptoKeysElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - cryptoKeys: cryptoKeys, - }; - - // Mock Grpc layer - client._innerApiCalls.listCryptoKeys = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.cryptoKeys); - }; - - client.listCryptoKeys(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.cryptoKeys); - done(); - }); - }); - - it('invokes listCryptoKeys with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listCryptoKeys = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listCryptoKeys(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listCryptoKeyVersions', () => { - it('invokes listCryptoKeyVersions without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const cryptoKeyVersionsElement = {}; - const cryptoKeyVersions = [cryptoKeyVersionsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - cryptoKeyVersions: cryptoKeyVersions, - }; - - // Mock Grpc layer - client._innerApiCalls.listCryptoKeyVersions = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.cryptoKeyVersions); - }; - - client.listCryptoKeyVersions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.cryptoKeyVersions); - done(); - }); - }); - - it('invokes listCryptoKeyVersions with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listCryptoKeyVersions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listCryptoKeyVersions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getKeyRing', () => { - it('invokes getKeyRing without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getKeyRing = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getKeyRing(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getKeyRing with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getKeyRing = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getKeyRing(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getImportJob', () => { - it('invokes getImportJob without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.importJobPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[IMPORT_JOB]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getImportJob = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getImportJob(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getImportJob with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.importJobPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[IMPORT_JOB]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getImportJob = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getImportJob(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getCryptoKey', () => { - it('invokes getCryptoKey without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getCryptoKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getCryptoKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getCryptoKey with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getCryptoKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getCryptoKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getCryptoKeyVersion', () => { - it('invokes getCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const importJob = 'importJob2125587491'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name2, - importJob: importJob, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.getCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createKeyRing', () => { - it('invokes createKeyRing without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const keyRingId = 'keyRingId-2056646742'; - const keyRing = {}; - const request = { - parent: formattedParent, - keyRingId: keyRingId, - keyRing: keyRing, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createKeyRing = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createKeyRing(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createKeyRing with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); - const keyRingId = 'keyRingId-2056646742'; - const keyRing = {}; - const request = { - parent: formattedParent, - keyRingId: keyRingId, - keyRing: keyRing, - }; - - // Mock Grpc layer - client._innerApiCalls.createKeyRing = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createKeyRing(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createImportJob', () => { - it('invokes createImportJob without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const importJobId = 'my-import-job'; - const importMethod = 'RSA_OAEP_3072_SHA1_AES_256'; - const protectionLevel = 'HSM'; - const importJob = { - importMethod: importMethod, - protectionLevel: protectionLevel, - }; - const request = { - parent: formattedParent, - importJobId: importJobId, - importJob: importJob, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createImportJob = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createImportJob(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createImportJob with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const importJobId = 'my-import-job'; - const importMethod = 'RSA_OAEP_3072_SHA1_AES_256'; - const protectionLevel = 'HSM'; - const importJob = { - importMethod: importMethod, - protectionLevel: protectionLevel, - }; - const request = { - parent: formattedParent, - importJobId: importJobId, - importJob: importJob, - }; - - // Mock Grpc layer - client._innerApiCalls.createImportJob = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createImportJob(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createCryptoKey', () => { - it('invokes createCryptoKey without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const cryptoKeyId = 'my-app-key'; - const purpose = 'ENCRYPT_DECRYPT'; - const seconds = 2147483647; - const nextRotationTime = { - seconds: seconds, - }; - const seconds2 = 604800; - const rotationPeriod = { - seconds: seconds2, - }; - const cryptoKey = { - purpose: purpose, - nextRotationTime: nextRotationTime, - rotationPeriod: rotationPeriod, - }; - const request = { - parent: formattedParent, - cryptoKeyId: cryptoKeyId, - cryptoKey: cryptoKey, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createCryptoKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createCryptoKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createCryptoKey with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const cryptoKeyId = 'my-app-key'; - const purpose = 'ENCRYPT_DECRYPT'; - const seconds = 2147483647; - const nextRotationTime = { - seconds: seconds, - }; - const seconds2 = 604800; - const rotationPeriod = { - seconds: seconds2, - }; - const cryptoKey = { - purpose: purpose, - nextRotationTime: nextRotationTime, - rotationPeriod: rotationPeriod, - }; - const request = { - parent: formattedParent, - cryptoKeyId: cryptoKeyId, - cryptoKey: cryptoKey, - }; - - // Mock Grpc layer - client._innerApiCalls.createCryptoKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createCryptoKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createCryptoKeyVersion', () => { - it('invokes createCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const cryptoKeyVersion = {}; - const request = { - parent: formattedParent, - cryptoKeyVersion: cryptoKeyVersion, - }; - - // Mock response - const name = 'name3373707'; - const importJob = 'importJob2125587491'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name, - importJob: importJob, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.createCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const cryptoKeyVersion = {}; - const request = { - parent: formattedParent, - cryptoKeyVersion: cryptoKeyVersion, - }; - - // Mock Grpc layer - client._innerApiCalls.createCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('importCryptoKeyVersion', () => { - it('invokes importCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const algorithm = 'CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED'; - const importJob = 'importJob2125587491'; - const request = { - parent: formattedParent, - algorithm: algorithm, - importJob: importJob, - }; - - // Mock response - const name = 'name3373707'; - const importJob2 = 'importJob2-1714851050'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name, - importJob: importJob2, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.importCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.importCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes importCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const algorithm = 'CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED'; - const importJob = 'importJob2125587491'; - const request = { - parent: formattedParent, - algorithm: algorithm, - importJob: importJob, - }; - - // Mock Grpc layer - client._innerApiCalls.importCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.importCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateCryptoKey', () => { - it('invokes updateCryptoKey without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const cryptoKey = {}; - const updateMask = {}; - const request = { - cryptoKey: cryptoKey, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateCryptoKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateCryptoKey with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const cryptoKey = {}; - const updateMask = {}; - const request = { - cryptoKey: cryptoKey, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateCryptoKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateCryptoKeyVersion', () => { - it('invokes updateCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const cryptoKeyVersion = {}; - const updateMask = {}; - const request = { - cryptoKeyVersion: cryptoKeyVersion, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const importJob = 'importJob2125587491'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name, - importJob: importJob, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const cryptoKeyVersion = {}; - const updateMask = {}; - const request = { - cryptoKeyVersion: cryptoKeyVersion, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('encrypt', () => { - it('invokes encrypt without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPathPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY_PATH]' - ); - const plaintext = '-9'; - const request = { - name: formattedName, - plaintext: plaintext, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const ciphertext = '-72'; - const expectedResponse = { - name: name2, - ciphertext: ciphertext, - }; - - // Mock Grpc layer - client._innerApiCalls.encrypt = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.encrypt(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes encrypt with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPathPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY_PATH]' - ); - const plaintext = '-9'; - const request = { - name: formattedName, - plaintext: plaintext, - }; - - // Mock Grpc layer - client._innerApiCalls.encrypt = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.encrypt(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('decrypt', () => { - it('invokes decrypt without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const ciphertext = '-72'; - const request = { - name: formattedName, - ciphertext: ciphertext, - }; - - // Mock response - const plaintext = '-9'; - const expectedResponse = { - plaintext: plaintext, - }; - - // Mock Grpc layer - client._innerApiCalls.decrypt = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.decrypt(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes decrypt with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const ciphertext = '-72'; - const request = { - name: formattedName, - ciphertext: ciphertext, - }; - - // Mock Grpc layer - client._innerApiCalls.decrypt = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.decrypt(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateCryptoKeyPrimaryVersion', () => { - it('invokes updateCryptoKeyPrimaryVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - const request = { - name: formattedName, - cryptoKeyVersionId: cryptoKeyVersionId, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKeyPrimaryVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateCryptoKeyPrimaryVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateCryptoKeyPrimaryVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - const cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - const request = { - name: formattedName, - cryptoKeyVersionId: cryptoKeyVersionId, - }; - - // Mock Grpc layer - client._innerApiCalls.updateCryptoKeyPrimaryVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateCryptoKeyPrimaryVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('destroyCryptoKeyVersion', () => { - it('invokes destroyCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const importJob = 'importJob2125587491'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name2, - importJob: importJob, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.destroyCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.destroyCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes destroyCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.destroyCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.destroyCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('restoreCryptoKeyVersion', () => { - it('invokes restoreCryptoKeyVersion without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const importJob = 'importJob2125587491'; - const importFailureReason = 'importFailureReason-494073229'; - const expectedResponse = { - name: name2, - importJob: importJob, - importFailureReason: importFailureReason, - }; - - // Mock Grpc layer - client._innerApiCalls.restoreCryptoKeyVersion = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.restoreCryptoKeyVersion(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes restoreCryptoKeyVersion with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.restoreCryptoKeyVersion = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.restoreCryptoKeyVersion(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getPublicKey', () => { - it('invokes getPublicKey without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const pem = 'pem110872'; - const expectedResponse = { - pem: pem, - }; - - // Mock Grpc layer - client._innerApiCalls.getPublicKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getPublicKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getPublicKey with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getPublicKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getPublicKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('asymmetricDecrypt', () => { - it('invokes asymmetricDecrypt without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const ciphertext = '-72'; - const request = { - name: formattedName, - ciphertext: ciphertext, - }; - - // Mock response - const plaintext = '-9'; - const expectedResponse = { - plaintext: plaintext, - }; - - // Mock Grpc layer - client._innerApiCalls.asymmetricDecrypt = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.asymmetricDecrypt(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes asymmetricDecrypt with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const ciphertext = '-72'; - const request = { - name: formattedName, - ciphertext: ciphertext, - }; - - // Mock Grpc layer - client._innerApiCalls.asymmetricDecrypt = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.asymmetricDecrypt(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('asymmetricSign', () => { - it('invokes asymmetricSign without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const digest = {}; - const request = { - name: formattedName, - digest: digest, - }; - - // Mock response - const signature = '106'; - const expectedResponse = { - signature: signature, - }; - - // Mock Grpc layer - client._innerApiCalls.asymmetricSign = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.asymmetricSign(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes asymmetricSign with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.cryptoKeyVersionPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - const digest = {}; - const request = { - name: formattedName, - digest: digest, - }; - - // Mock Grpc layer - client._innerApiCalls.asymmetricSign = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.asymmetricSign(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new kmsModule.v1.KeyManagementServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.keyRingPath( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} diff --git a/packages/google-cloud-kms/tsconfig.json b/packages/google-cloud-kms/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-kms/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-kms/tslint.json b/packages/google-cloud-kms/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-kms/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-kms/webpack.config.js b/packages/google-cloud-kms/webpack.config.js index 2744daebeec..89fa4760041 100644 --- a/packages/google-cloud-kms/webpack.config.js +++ b/packages/google-cloud-kms/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'kms', - filename: './kms.js', + library: 'KeyManagementService', + filename: './key-management-service.js', }, node: { child_process: 'empty', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + 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[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], },